Thread correct answers program unit executed independently of other parts of the program
What do you need to create a thread correct answers Runnable interface and a class that
implements the runnable interface
How does a thread ends correct answers it ends when the run() method terminates (returns)
t.interrupt() - returns boolean value correct answers NOTIFIES that thread should end (does not
end thread itself ,
sleep() correct answers watches and checks for interrupted exception
thread scheduler correct answers runs each thread for a short amount of time
race condition correct answers the effect of multiple threads on shared data
depends on the order in which the threads are scheduled.
lock object correct answers used to control threads that manipulate shared resources
3 steps to use lock correct answers 1. create lock
2.initialize lock
3. lock then unlock
deadlock correct answers when one thread holds back indefinitely and others cannot acquire lock
condition object correct answers will not release object till condition is met
.await() correct answers calling thread will wait until signaled
.signalAll() correct answers unblocks all threads waiting on condition
3 parts of recursion correct answers base case, recursive case, case that leads to the base case
When is recursion not a good idea ? correct answers repeated sub problems (fibonacci)
bottom up approach that remembers small solutions better
What are the 3 examples of types of basic recursive code correct answers Binary Search, Divide
and conquer, merge-sort
linked lists correct answers uses reference pointers between list nodes (elements) to maintain
order
tree correct answers hierarchical data structure in which each element has only one predecessor
and zero one, or more successors