Q. In a binary tree, what is the maximum number of children a node can have?
-
A.
One
-
B.
Two
-
C.
Three
-
D.
Unlimited
Solution
In a binary tree, each node can have at most two children, typically referred to as the left and right child.
Correct Answer:
B
— Two
Learn More →
Q. Which data structure is best suited for implementing a stack?
-
A.
Array
-
B.
Linked List
-
C.
Both Array and Linked List
-
D.
None of the above
Solution
Both arrays and linked lists can be used to implement stacks, as they both support LIFO (Last In First Out) operations.
Correct Answer:
C
— Both Array and Linked List
Learn More →
Q. Which of the following operations is NOT efficient for a linked list?
-
A.
Insertion at head
-
B.
Insertion at tail
-
C.
Accessing an element by index
-
D.
Deletion of a node
Solution
Accessing an element by index in a linked list requires O(n) time, as it must traverse the list from the head.
Correct Answer:
C
— Accessing an element by index
Learn More →
Showing 1 to 3 of 3 (1 Pages)