What is the value at the front (or top) of the c++ queue o, after these operations? queue int> Q: Q. push (5) Q.push (4)
Posted: Sat May 14, 2022 4:48 pm
What is the value at the front (or top) of the c++ queue o, after these operations? queue int> Q: Q. push (5) Q.push (4): Q.push(6) Q-pop Q.push (7) Q.pop(); O 7 6) 05 9 0 06 04
For the following graph, which of the following sequences can be a BFS sequence starting from node 3? 7 3 4 8 2 6 1 5 0 3.7.4, 2, 6, 1.8.5 0 3.2, 81,4,6, 5.7 0 3.2.1.7. 4 6 8.5 O 3.6.5.4.7.2.18
Given a linked 1 ->7->NULL and head pointing to first node 1, which of the following operations changes the linked to 2->2-> NULL with head pointing to first node 2? O nend->next->next - head: O head->next = NULL: O swap (head->val, bend-next->val) head head next
Which of the following functions returns the sum of leaves of given tree? O int sumleaves (tree_node* r) { if (==NULL) return 0; if (r->left = NULL && r->right==NULL) return r->val; return sumleaves (r->left) + sumleaves (r->right); O int sumleaves (tree node* r) { if (r==NULL) return 0; if (r->left NULL && r->right==NULL) return r->val; return sumleaves (r->left) + sumleaves (r->right) + r->val; 3 O int sumleaves (tree node* r) { if (r->left NULL && r->right==NULL) return r->val; return sumleaves (r->left) + gumleaves (r->right) + r->val; O int sumleaves (tree node* r) { if (r==NULL) return 0; if (r->left -- NUIL && r->right==NULL) return r->val; 7
Which of the following data structures is the best for implementing a class similar to 'set' in C++? O linked list O adjacency matrix O binary heap O hash tables
Which of the following sorting algorithms has the best best case complexity? O insertion sort O selection sort O quick sort O merge sort
For the following graph, which of the following sequences can be a BFS sequence starting from node 3? 7 3 4 8 2 6 1 5 0 3.7.4, 2, 6, 1.8.5 0 3.2, 81,4,6, 5.7 0 3.2.1.7. 4 6 8.5 O 3.6.5.4.7.2.18
Given a linked 1 ->7->NULL and head pointing to first node 1, which of the following operations changes the linked to 2->2-> NULL with head pointing to first node 2? O nend->next->next - head: O head->next = NULL: O swap (head->val, bend-next->val) head head next
Which of the following functions returns the sum of leaves of given tree? O int sumleaves (tree_node* r) { if (==NULL) return 0; if (r->left = NULL && r->right==NULL) return r->val; return sumleaves (r->left) + sumleaves (r->right); O int sumleaves (tree node* r) { if (r==NULL) return 0; if (r->left NULL && r->right==NULL) return r->val; return sumleaves (r->left) + sumleaves (r->right) + r->val; 3 O int sumleaves (tree node* r) { if (r->left NULL && r->right==NULL) return r->val; return sumleaves (r->left) + gumleaves (r->right) + r->val; O int sumleaves (tree node* r) { if (r==NULL) return 0; if (r->left -- NUIL && r->right==NULL) return r->val; 7
Which of the following data structures is the best for implementing a class similar to 'set' in C++? O linked list O adjacency matrix O binary heap O hash tables
Which of the following sorting algorithms has the best best case complexity? O insertion sort O selection sort O quick sort O merge sort