Question

I. In the example of recycling the elements of a list in O1) time, which situation holds? A. Both lists are circular B. Both ists are not circular C. The list to be recycled is circular, the garbage list is not D. The garbage list is circular, the list to be recycled is not 2. What is the worst-case time to perform MINIMUML) for a sorted, doubly-linked list with nodes? A.6(1) B. Θ(log n) C. Θ(n) D. Θ(nlogn) . Which binary tree traversal corresponds to the following recursive code? void traverse (noderef x) if (x==null) retur / process x here traverse(x.left) traverse(x.right) A. norder B. postorder C. preorder D. search for key x 4. Suppose that only numbers in 100 appear as keys in a binary search tree. While searching for 50, which of the following sequences of keys could not be examined? A. 10, 30, 70, 60, 30 C. 1, 100, 20, T0, S0 B. 100, 20, 80, 30, 50 D. 10, 40, 70, 30, 50 5. What does counting sort count? A. the number of bytes in the input array B. the number of occurences for each possible key value C. the number of different input values that have oecured D. the maximum length among al the strings being sorted 6. Which of the following is not true regarding dynamic programming? A. It is a form of divide-and-conquer C. A cost function must be defined B. It is a form of exhaustive search D. The backtrace may be hased on recomputing the cost function . The time to extract the LCS for sequences of lengthsand ) atter filling in the dynamic programming matrix is in: C. Θ(n logn) D. emn) 8. The qucue for breadth-first rat-in-a-maze stores A. all maze positions that have walls B. maze positions that must be in the final path C. maze positions that have been reached D e current path being explored 9. For which of the following sorts does the decision tree model not apply? I0. Given a pointer to a node, the worst-case time to delete the node from a singly-linked list withn nodes in ascending order 11. Memoization is associated with which technique? A. Insertion B. LSD Radix Sort C. MERGE-SORT D. QUICKSORT C. Θ(n loge) A. top-down dynamic programming C. greedy methods B. circular lists D. bottom-up dynamic programming 12. If POP is implemented as return stackSPl, then PUSH of element X is implemented as A. return stack[SP++] B. stack[SP++]=X C. stack-SPJ-X D. stack[++SP]-X 13. The cost function for the optimal matrix multiplication problem is isk<j isk<j C. ct İskej 14. The worst-case number of comparisons for finding the kth largest of n keys using PARTITION is in which asymptotic set? A Θ(log n) B. Θ(n) c Θ(nlogn) 15. Suppose a (singly) linked list is used to implement a queue. Which of the following is true? A. The head points to the first element and the tail points to the last element, B. The tail points to the fist element and the head points to the last element. . Like a cular queue, the maximum number of items is determined at initialization D. One node is always wasted

can anyone provide answers with explaination ? thanks a lot

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. Answer: C Explanation: The list to be recycled is circular because repeatedly go around the list and it takes O(1) for rec

4. Answer: D . Explanation: find 50 in BST: In first option 10 is root node, our key is greater than 10 so we go for right BS

1. Answer: D Explanation: Whenever the function Ics(m, n) with the same argument m and n are called again, do not perform any

11. Answer: A Explanation: In Memoization, you store the expensive function calls in a cache and call back from there if exis

15. Answer: A Explanation: For queue, inserting elements at end of the list and removing list from front of the list, so head

Add a comment
Know the answer?
Add Answer to:
can anyone provide answers with explaination ? thanks a lot I. In the example of recycling...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Can you please help with the below? 1)   Which of the following is true about using...

    Can you please help with the below? 1)   Which of the following is true about using a 2-3-4 tree? a.   It is designed to minimize node visits while keeping to an O(log n) search performance b.   It is designed to self-balance as new values are inserted into the tree c.   As soon as a node becomes full, it performs the split routine d.   None of the above 2)   Which of the following is true about a binary search tree? a.  ...

  • Please answer for all the subparts, explaination is not necessary, only answers will suffice. 1) How...

    Please answer for all the subparts, explaination is not necessary, only answers will suffice. 1) How many startDocument events and how many startElement events will be fired when the following XML SAX parser? <a> <b q='yyy'>zzz</b> <c>nnn</c> <d>ppp</d> </a> a) O startDocument events and 4 startElement events b) O startDocment events and 3 startElement events c) 1 startDocment events and 4 start Element events d) 1 startDocment events and 3 startElement events 2) The bracket in the following is an...

  • I also don't quite understand the meaning of N.size, is N.size (the sum of nodes) (a...

    I also don't quite understand the meaning of N.size, is N.size (the sum of nodes) (a node and its sub trees) has? please also explain that, thank you. modify the standard definition of a binary search tree to add a field N.size at each Suppose that we node, which records the size of the subtree under N'Tincluding N itself). A. Explain how to modify the procedure for adding both the case where X is not yet in the tree and...

  • JAVA 3 PLEASE ANSWER AS MANY QUESTIONS AS POSSIBLE! ONLY 2 QUESTIONS LEFT THIS MONTH!!! Question...

    JAVA 3 PLEASE ANSWER AS MANY QUESTIONS AS POSSIBLE! ONLY 2 QUESTIONS LEFT THIS MONTH!!! Question 12 pts Which is a valid constructor for Thread? Thread ( Runnable r, int priority ); Thread ( Runnable r, String name ); Thread ( int priority ); Thread ( Runnable r, ThreadGroup g ); Flag this Question Question 22 pts What method in the Thread class is responsible for pausing a thread for a specific amount of milliseconds? pause(). sleep(). hang(). kill(). Flag...

  • 17. Given the following definition of function £, what does the expression "t (1: 2: 3]::" return? let rec f listl match listl with 1 I head::rest -> head f resti b. 6 c. 120 d. 123 456...

    17. Given the following definition of function £, what does the expression "t (1: 2: 3]::" return? let rec f listl match listl with 1 I head::rest -> head f resti b. 6 c. 120 d. 123 456 e. g. 14; 5; 6] h. (6; 5; 4] i. Error message j. None of the above 18. Which of the following is the correct meaning of the C declaration "double (*a [n]) "? a is an array of n pointers to...

  • 6 6. Merge Bubble Sort: a) How does the merge bubble sort break the array into...

    6 6. Merge Bubble Sort: a) How does the merge bubble sort break the array into sublists? b) What does it need to use for each sublist and then what does it do with all of the sublists? c) What is the Big-O notation for this sort? 7. Merge Sort: a) How does the merge sort use recursion to break the array into sublists? b) What happens to each of these sublists to get the final sorted list? c) What...

  • NEED ASAP PLEASE WILL GIVE GOOD RATE RIGHT AWAY FOR ALL ANSWERS! MULTIPLE CHOICE no explanation...

    NEED ASAP PLEASE WILL GIVE GOOD RATE RIGHT AWAY FOR ALL ANSWERS! MULTIPLE CHOICE no explanation needed SPRING Cs 424-524 aUESTION 1 12 points each, 30 points total +2 extra) Multiple 1. The main reason to include enumeration types in a programming language is to TEST2 choice: circle or check the best answer a. Make programs run faster b. Improve program readability c. Eliminate unnecessary /O d. Reduce type errors 2. A C++ value parameter is an example of a....

  • JAVA 3 LECTURE REVIEW PLEASE NEED ANSWERS ASAP. DUE IN AN HOUR!!! Question 12 points The...

    JAVA 3 LECTURE REVIEW PLEASE NEED ANSWERS ASAP. DUE IN AN HOUR!!! Question 12 points The best-case performance for a shell sort is: --- O(1) O(n2)   O(n) O(n log n)   Signaler cette question Question 22 points The best-case performance for an array of n items using insertion sort is: --- O(n2)   O(n) O(1) there is no best-case Signaler cette question Question 3 2 points A recursive method that processes a chain of linked nodes --- uses the first node in...

  • Plz help me with the code. And here are the requirement. Thanks!! You are required to...

    Plz help me with the code. And here are the requirement. Thanks!! You are required to design and implement a circular list using provided class and interface. Please filling the blank in CircularList.java. This circular list has a tail node which points to the end of the list and a number indicating how many elements in the list. And fill out the blank of the code below. public class CircularList<T> implements ListInterface<T> { protected CLNode<T> tail; // tail node that...

  • Please provide original Answer, I can not turn in the same as my classmate. thanks In...

    Please provide original Answer, I can not turn in the same as my classmate. thanks In this homework, you will implement a single linked list to store a list of computer science textbooks. Every book has a title, author, and an ISBN number. You will create 2 classes: Textbook and Library. Textbook class should have all above attributes and also a “next” pointer. Textbook Type Attribute String title String author String ISBN Textbook* next Textbook Type Attribute String title String...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT