Question
can anyone pkeasee pleasee answer allllll the following questionsssss bitsss 120) which method is not meaningfull for use on an empty list? a. getEntry b.replace
can anyone pkeasee pleasee answer allllll the following questionsssss bitsss
120) which method is not meaningfull for use on an empty list? a. getEntry b.replace c all other answers d. remove 121.in the array based list implementation of the ADT what is the worst case time efficiency of the getEntry method? a.O(n2) b.O(1) c.O(n) d.O(logn) 122) which functionality is part of the ADT sorted list given the entry as an argument? a. add b. all other answers c.locate d. remove 123.in the array based list implementation of the ADT what is the worst case time efficiency of the remove method? a.O(n2) b.O(1) c.O(n) d.O(logn) 124. In the ADT sorted list, hwat does the getPosition method do when the list is empty? a.return-1 b.return 1 c.throw an unfoundElementException d.return 0 125)Given the following definition,
SortedListedInterface
What does the list look like after the following operations?
amphibianList.add("salamander");
amphibianList.add("iguana");
amphibianList.add("lizard");
amphibianList.add("gecko");
amphibianList.add("toad");
amphibianList.remove(6);
a. 0
b. Salamander
C. Null
D. Throws an exception
126)a list where entries are compared to each other and ordered accordingly is called
A. Ordered list
B. Sorted list
C. Comparative list
D. Stream lined list
127)in the ADT sorted list, what does the getPosition method do when the entry being searched for is not in the list?
A. Return 0
B. Return negative
C. Return false
D. Throws an unfound element exception
128)in the link based implementation of the ADT sorted list what is the worst case time efficiency of the remove method?
A. O(1)
B.O(logn)
C.O(n)
D.O(n2)
129)in the link sorted list implementation how many references do you need to traverse the list?
A. 2, B. 1 c. None d. 3
130)Given the following definition,
SortedListedInterface
What does the statement
amphibianList.contains("frog") return after the following operations?
amphibianList.add("iguana");
amphibianList.add("salamander");
amphibianList.add("gecko");
amphibianList.add("toad");
amphibianList.madd("lizard");
a. 0
b. False
C. Null
D. Throws an exception
131)in open addressing with linear probing we must consider how to encode
A. Occupies positions
B. Available positions
C. All other answers
D.empty positions
132)A(n) ___ mals each search key into a different integer that is suitable as an index to the hash table
A. Perfect hash function
B. Black box
C. Hash index
D. Search key index
133)using a second hash function to compute increments for probe increments is called
A. Probe counting
B. Sequence hashing
C. Double hashing
D. Function hashing
134)finding an unused location in the hash table is called
A. Hash searching
B. Both of the answers
C.none of the other answers
D.open addressing
135)duplicate hash code
A. Create collisions
B. Destro with hash table
C. Are necessary for a perfect hash table
D. All other amswers
136)the technique for determining an array index using only a search key and not searching is called
A. Direct indexing
B. Stealth searching
C. Hashing
D.search key indexing
137)typical has functions are not perfect because
A. They allow collisions
B.none of the other answers
C. Both of the answers
D.they allow more than once hash key to map to the same index
138)search key can be
A.both of the amswers
B. An instance of a class
C.none of the other answers
D.a primitive data type
139)divinding a long search key into pieces and combining them through addition or a bit wise boolean operation is called
A. Folding
B. Combining
C. Hashing
D.optimizing
140)resolving collisions by using buckets that are linked chains is called
A. List resolution
B. Bucket chaining
C. Separate chaining
D. Joint chaining 141)nodes that are children of the same parent node are called
A. Descendants
B.sibilings
C. Ancesotrs
D. Roots
142)In a ___ traversal of a binary tree, you visit the root node before you visit the roots subtrees
A. Inorder
B. Postorder
C. Level order
D. Preorder
143) In a ___ traversal of a binary tree, you begin at the root and visit nodes one level at a time
A. Inorder
B. Flat order
C. Level order
D. Straight order
144)the number of levels in a tree is called
A. Size
B. Node count
C. Branch level
D. Height
145)when a binary tree is full to its next to last level and its leaves on the last level are filled from left to right the tree is said to be
A. Ordered
B. Populated
C. Organized
D.complete
146)the ___ node is the only mode that has no parent
A. Root
B. Binary
C.child
D.n-ary
147)a___ is a complete binary tree such that each node in the tree contains a comparable object that us greater than or equal to the objects jn the nodes descendants
A. Binheap
B. Maxheap
C. Fullheap
D. Minheap
148)when you classify data into groups and subgroups you are using a(n) ____ order?
A. Circular
B. Hierarchical
C. Linear
D. Group
150.at the top level of a tree is a single node called the ________ a)pinnacle b) root c) top d)front 49)In the program stack, the record at the top of the stack belongs ti the method
A. That called the method tahg is currently executing
B. None of the other answers
C. That is scheduled to execute next
D. That is currently executing
50)An expression that has correctly paired delimiters is called a(n)
A.reverse polish expression
b.algebraic expression
C.infix expression
D. Balanced expression
51)The stack ADT may be implemented with
A. A vector
b. A linked chain
C. All other answers
D. An array
52)In a vector implementation of a stack ADT, you clear all of the contents of a stack using which vector method
a. Clear
B. Delete
C. Delete all
D. None of the other answers
53)In a vector implementation of a stack ADT , you remove an entry from the top of a stack using which vector method?
A. None of the amswers
B.pop
C.remove
D.retrieve
54)In a linked chain implementation of a stack ADT,the performance of pushing an entey onto the stack js
A.O(n2)
B. O(1)
C.O(2)
D.O(n)
55)when a vecotr needs to j crease its size
A. The capacity is increased by 10 empty entries
B. Capacity increase is user defined
C.capacity is doubled
D. Capacity is increased by 1 as needed
56)In an array based chain implementation of a stack ADT
The entry peek returns may be found at
A. Last occupied location inthr array
B.first lication in the array
C.last location in the array
D. None of the other answers
57)what objective behaves like a high level array
A. All other answers
b.array chain
C.vector
D. Linked chain
58)In a vector implementation of a stack ADT, you add an entry to the top of a stack using which vector method?
A. Push
B.add
C.none of the other answers
D.put
59)in an array based chain implementation of a stack ADT what is the performance of the ensure capacity method when the array is full
A.O(n2)
B. O(1)
C.O(nlogn)
D.O(n)
60)in a linked chain implementation of a stack ADT the performance of popping am emtry from the stack is
A.O(n2)
B. O(1)
C.O(2)
D.O(n)
61)the efficinecy for solving the towers of hanoi problem recursively
A.O(n2)
B. O(2n)
C.O(logn)
D.O(n)
62)What question should you keep in mind when debugging a recursive method
A. Is there at least one recursive call
B.did u consider all possible cases
C. All other answers
D. Does the method contain a statement to test an input value and leads to different cases?
63)what is the output of the following program when the method is called with 4?
void unknown(int n)
{
if(n>0)
{
System.out.print("?");
unkown(n-1);
}
}
A. None of the other answers
B.???
C.?????
D.????
64)when mehtod X calls method Y , method Y called methhod Z, and method Z calles method X, this is called
A. An error
B. Mutual recursion
C.tail recursion
D.indirect recursion
66)The efficiency for recursively traversing a chain of linked nodes is
A.O(n2)
B. O(1)
C.it cannot be proven
D.O(n)
67)recursive methhod need a(n)
A. Trace
B.base case
C. For loop
D.all other answers
68)the efficiency for recursuvely calculating xn is
A.O(nlogn)
B. O(n)
C.O(logn)
D.O(n2)
69)A recursive method that processes a chain of linked nodes
A.uses last nodes in chain
B. Divides the chain in half placing the middle node jn the right chain
C.divides the chain in the half the middle node jn the left chajn
D.uses first node in the chain
70)what is the output of the following program when the method is called with 4?
void unknown(int n)
{
if(n>0)
unkown(n-1);
System.out.print("?");
}
A. None of the other answers
B.???
C.?????
D.????
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