Question: MCQ (NEED CORRECT ANSWERS ONLY 15. In a singly linked list, if the node pointed by p is not the last node, then to insert

MCQ (NEED CORRECT ANSWERS ONLY 15. In a singly linked list, if the node pointed by p is not the last node, then to insert a node pointed by s after p, we must do: a) s->next=p->next; p=5; b) p->next=s; s->next=p; c) s->next=p; p->next=s; d) s->next=p->next; p->next=s; 16. If graph G is NOT connected and has 20 edges, then it must have at least vertices. a) 10 b) 8 c) 9 d) 7 17. Given input (4371, 1323, 6173, 4199, 4344, 9679, 1989) and a hash function h(X)=X%10. If the collisions are solved by quadratic probing with table size being 10, then the indices of the input numbers in the hash table are: (-1 means the insertion cannot be successful) a) 1, 3, 3, 9, 4, 9, 9 b) 1, 3, 4, 9, 5, 0, 8 c) 1, 3, 4, 9, 5, 0, 2 d) 1, 3, 4, 9, 7, 5, -1 18. Suppose that a polynomial is represented by a linked list storing its non-zero terms. Given two polynimials with Ni and N2 non-zero terms, and the highest exponents being Mi and M2, respectively. Then the time complexity for adding them up is: a) O(N1xN2) b) O(N1+N2) c) O(M1+M2) d) O(MxM2) 19. Given a tree of degree 3. Suppose that there are 3 nodes of degree 2 and 2 nodes of degree 3. Then the number of leaf nodes must be a)7 b) 8 c) 6 d) 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
