CIT 594 Final Exam questions and
answers graded A+
Tree Set - correct answer A set interface that uses a tree for storage
what is the time complexity of a single for loop? - correct answer O(n)
What is the time complexity of linked list's get operation? - correct answer O(n)
How is the bucket number calculated for a hash set? - correct answer hash code %
number_of_buckets
AVL Tree - correct answer a self-balancing sorted binary tree, in which the heights of subtrees differ
by at most 1.
Max Heap - correct answer a complete binary tree in which the value in each internal node is greater
than or equal to the values of the children in those nodes (Note* NOT the SUM, just each individual
value)
What does the factory method do? - correct answer For the factory method pattern, we need to
define an abstract class that subclasses can use to return subclasses of the dependency
What is a race condition in regards to Threads? - correct answer When you don’t know what thread
will finish first, so therefore the threads are "racing" against each other and you have thread non
determinism... (not good)
What does UML stand for? - correct answer Unified Modeling Language
How does a stack operate? - correct answer -think of a stack as literally a stack of bricks but each
element contains data
-It is a linked list that is last in first out
answers graded A+
Tree Set - correct answer A set interface that uses a tree for storage
what is the time complexity of a single for loop? - correct answer O(n)
What is the time complexity of linked list's get operation? - correct answer O(n)
How is the bucket number calculated for a hash set? - correct answer hash code %
number_of_buckets
AVL Tree - correct answer a self-balancing sorted binary tree, in which the heights of subtrees differ
by at most 1.
Max Heap - correct answer a complete binary tree in which the value in each internal node is greater
than or equal to the values of the children in those nodes (Note* NOT the SUM, just each individual
value)
What does the factory method do? - correct answer For the factory method pattern, we need to
define an abstract class that subclasses can use to return subclasses of the dependency
What is a race condition in regards to Threads? - correct answer When you don’t know what thread
will finish first, so therefore the threads are "racing" against each other and you have thread non
determinism... (not good)
What does UML stand for? - correct answer Unified Modeling Language
How does a stack operate? - correct answer -think of a stack as literally a stack of bricks but each
element contains data
-It is a linked list that is last in first out