postfix conversions Quiz - ICSE Class 12 Computer Science
Free practice quiz: postfix conversions (ICSE Class 12 Computer Science). 48 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
Play all 48 questions freeSample questions
In a singly linked list, if the head pointer is NULL, what does it signify?
- The list is full
- The list is empty
- The list has only one node
- The list is corrupted
Show answer
Answer: B. The list is empty
In a singly linked list, the head pointer points to the first node. If the head pointer is NULL, it means there are no nodes in the list, hence the list is empty.
Which operation on a stack would result in an 'underflow' error?
- Pushing an element onto an empty stack
- Popping an element from a non-empty stack
- Popping an element from an empty stack
- Peeking at an element in a non-empty stack
Show answer
Answer: C. Popping an element from an empty stack
Stack underflow occurs when an attempt is made to pop or peek at an element from an empty stack. There are no elements to retrieve, hence the error.
Which type of binary tree traversal visits nodes in ascending order of their keys?
- Pre-order
- In-order
- Post-order
- Level-order
Show answer
Answer: B. In-order
An in-order traversal of a Binary Search Tree (BST) visits the nodes in ascending order of their keys. The process is: traverse left subtree, visit root, traverse right subtree.
Which property does a balanced binary search tree aim to maintain?
- Minimum height for the number of nodes
- Maximum height for the number of nodes
- Equal number of nodes in left and right subtrees
- Constant height regardless of the number of nodes
Show answer
Answer: A. Minimum height for the number of nodes
A balanced binary search tree (like AVL trees or Red-Black trees) ensures that the height of the tree remains logarithmic with respect to the number of nodes (O(log n)). This is achieved by maintaining a relatively small height, which leads to efficient search, insertion, and deletion operations with an average and worst-case time complexity of O(log n).
What is the time complexity for deleting an element from the front of a queue implemented using a singly linked list?
- O(1)
- O(log n)
- O(n)
- O(n^2)
Show answer
Answer: A. O(1)
Deleting an element from the front of a queue implemented with a singly linked list is an O(1) operation. This involves simply updating the head pointer to point to the next node in the list.
Browse all Data Structures – stack, queue, dequeue, linked list, binary trees, infix quizzes