+1 917 8105386 [email protected]

Assignment #5

Assignment #5 Computer Programming II (CS141) Last date of submission – 11:59PM, 6th Dec 2015 Total Marks: 10 Q.1. Explain the difference between A) a set and a map B) a binary tree and a balanced binary tree (1 Mark) Q.2. Write a loop that prints all elements that are in both set<string>s and set<string>t. (1 Mark) Q.3. What is Big-O notation? Give some examples? (1 Mark) Q.4. A) If a min-heap has 1024 nodes, calculate its height? B) If we insert into an empty binary search tree the following sequence of nodes with the specified keys, what will be root key? Keys: 12, 7, 25, 6, 9, 13, 44 (1 Mark) Q.5. Consider the following tree and write the inorder traversal. (1 Mark) Bonus Questions Q.6. Write a program to demonstrates a heap as a priority queue by using a class which can encapsulates a work order with a priority. (5 Marks)

Ready To Get Started?

GET STARTED TODAY