Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answers for these questions please urgent!! - Short Answer: Data Abstraction 1 . When would it make the most sense for the Point 2 D
Answers for these questions please urgent!! Short Answer: Data Abstraction
When would it make the most sense for the PointD class to use polar coordinates for its internal
representation? points
a When fast trigonometry functions are available.
b When the polar coordinates accessor and mutator methods will be used most often.
c When the API provides both Cartesian and polar coordinate methods.
d It never ever matters!
When it comes to functionality not performance is it important to know how an ADT is internally
implemented? Explain. points
Short Answer: Stacks, Lists, and Generics
Consider an implementation of unsorted singly linked list. Suppose it has a representation with a head
and a tail pointer, where head's next eventually leads to tail. Given this representation, which of the
following operation cannot be implemented in O time? points
a Insertion before the head node of the linked list.
b Insertion after the tail node of the linked list.
c Deletion of the head node of the linked list.
d Deletion of the tail node of the linked list.
Assume that we are storing the ASU IDs of students in a singly linked list. Due to a security breach,
one entire node has been corrupted in the middle. In this case, will all the nodes still be accessible
to us points
a Yes the Java garbage collector will delete the bad node from the list.
b Yes although we do not have a previous reference, we can use the tail reference.
c No any nodes that follow the corrupted node will be inaccessible.
d No the entire list will be lost and the data will be inaccessible.
Short Answer: Analysis of Algorithms
Consider the following growth function: points
fnlognnn
What is the BigOh order of this function? You should provide a relatively tight upper bound eg
not just n
a On
b Onlogn
c Onlogn
d On
e Ologn
What is the BigOh order of the following code fragment? The fragment is parametrized on the variable
n Assume that you are measuring the number of println calls. You should provide a relatively tight
upper bound eg not just n points
f o r int i ; i n ; i
f o r int j ; j n ; j
System out p r i n t l n Nested l o o p s ;
a On
b Onlogn
c Onlogn
d On
e Does not exist.
Short Answer: Analysis, Design, and Justication I
Acua Consider the following problem, and categorize it according to the dierent axis of problem
complexity: nd the moves to win a game of chess with standard rules. points
a Openended, Welldened
b Openended, Illdened
c Closeended, Welldened
d Closeended, Illdened
Vega Suppose you are given the following problem:
Problem: Consider designing a program that reads a list of IDs from the user and then sorts them and prints them all back to the user. Short Answer: Analysis of Algorithms
Consider the following method, excerpted from a protein structural prediction algorithm. Assume that
any variables not given as parameters are available as globals.
Give a growth function for fragment that counts the number of assignments in the inner loop
based on points
Consider the following algorithm that implements linear search:
If you were asked to analyze the performance of this algorithm, would it be useful to write a growth
function that counts the number of times the return false statement will execute? That is use the
number of returns as the cost metric. Explain. pointsCreate an Analysis of this problem by identifying any illdened parts of the problem, making reason
able assumptions for each if possible and identifying any important metrics. Justify any assumptions you make. points P and C What would
the result of executing the following code be Draw the resulting list using box and arrow notation and include any variables. points
head.getNextgetNextsetNextheadgetNext; What would be the difference in memory usage for storing a thousand elements in an array vs a linked
list? Which takes less space? Explain. points
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started