• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 4 pages
Exam (elaborations)

2110 Final Exam(with Errorless answers)

Document preview thumbnail
Preview 1 out of 4 pages

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) rupt() - 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 alize 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

Content preview

2110 Final Exam(with Errorless answers)
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

Document information

Uploaded on
April 30, 2025
Number of pages
4
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.39

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Sold
23
Followers
6
Items
4026
Last sold
2 months ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions