The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 305 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
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<String> amphibianList=newSortedList<>();
Â
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<String> amphibianList=newSortedList<>();
Â
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.????
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly