Q10 (2%) Fill in the table with worst-case time complexity for these operations operation Print all possible shuffles of N cards Print all subsets of a set of size N Big Oh a) b) Q11 (8%) Choose from this list to answer below (N items stored in each data structure) A. Basic linked list (not sorted) B. BST tree (with no balancing being done) C. Hash table D. AVL tree E. Splay tree F. Skip list G. None of these (you may use this multiple times if you wish) Data Structure Worst case find time complexity Average case find time complexity O(N) 0(1) i) O(N) O(log N) ii)
Data Structure i) ii) iii) iv) v) vi) vii) viii) worst case Tina time complexity O(N) O(N) amort O(log N) O(log N) almost impossible O(N) O(N) 0(1) O(log N) Average case fina time complexity 0(1) O(log N) O(log N) 0(1) O(log N) O(N/2) 0(1) O(log N)
(2.4%) For each indicate T or F (true or false) in the blank for the item being a primitive type in Java: a) long b) int Ee) const Ed) heap T e) Array F f) package Eg) String I h) boolean 1) double T j) static k) interface 1 1) class Em) nap 1o) stack Fn) dictionary p) float 2.4%) For each indicate T or F (true or false) in the blank for the item being a reference type in 1 a) long F b) int I c) Object d) heap e) garbage f) package g) float h) boolean i) double j) static k) Array 1) const m) nap n) string o) stack p) dictionary 444444 I T
Q12 (6%): Topological sort For the graph shown following, give a topological sort. When you have a choice for next node, choose the smallest alphabetically. Show your work for possible partial credit. Answer: C Work: T M B R K E
Q13 (6%) True or False (T/F): a) b) c) d) e) f) Q14 (3%) Consider the structure represented to the right. a) (T/F) This could be a min binary heap b) (T/F) This could be a splay tree c) (T/F) This could be a (balanced) AVL tree No undirected graph can have only one node with odd degree No polynomial time algorithm can exist to find Hamiltonian paths in a graph In a balanced AVL tree, the shortest path and the longest path may differ by more than 1 There is no known linear time algorithm for finding Euler paths in a graph The SHA-256 hash function guarantees that any 2 unique strings of text will produce 2 different values when hashed If a undirected graph with weighted edges has exactly one minimum spanning tree then two edges might have the same weight 16 10 29 12 24 33 19
Q10 (2%) Fill in the table with worst-case time complexity for these operations operation Print all possible shuffles of
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Q10 (2%) Fill in the table with worst-case time complexity for these operations operation Print all possible shuffles of
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!