What are true about trees?
What is the base case in the following recursive function? …
What is the base case in the following recursive function? int xFunction(int n) { if (n == 1) return 1; else return n + xFunction(n – 1);}
What is the time complexity of the following code? for (int…
What is the time complexity of the following code? for (int i
What will be the output datatype of this template: templateT…
What will be the output datatype of this template: templateT max(T a, T b) { return (a > b) ? a : b;} When used with this input? max(14.5, 9.5)
Let list1 be a Vector and list2 be a Linked List. Both conta…
Let list1 be a Vector and list2 be a Linked List. Both contain 1 million double values. How do code A and code B compare? A: for (int i = 0; i
Which method is best for finding the shortest path between v…
Which method is best for finding the shortest path between vertices in unweighted graphs?
_____________ is best for broadcasting messages to multiple…
_____________ is best for broadcasting messages to multiple nodes as efficiency as possible.
If [0, 1, 2, 3, 4, 5, 6, 7] represents a binary heap, what i…
If represents a binary heap, what is the parent of element “5”?
If a sorted list has 1,000,000 elements, approximately how m…
If a sorted list has 1,000,000 elements, approximately how much more work is it to do linear search compared to binary search in the worst case? In other words, what is (# units of work for linear) / (# units of work for binary)? Hint: Normally when we refer to “log” we mean the base 10 logarithm. However when dealing with things that you continuously cut in half, base 2 is what you want. Googling “log2(26)” will return the base 2 logarithm of 26.
If you insert 4, 5, 1, 2, 9, 3 into a binary search tree in…
If you insert 4, 5, 1, 2, 9, 3 into a binary search tree in this order, what is the preorder traversal of this tree?