OA. free
Free
Qualcomm Embedded Systems & Hardware Embedded Systems & Hardware Medium

Which one of the given options is not a type of binary tree?

Qualcomm technical mcq question, verified with a worked answer. Free to practise - no sign-up.

Which one of the given options is not a type of binary tree?

Choose one option.
Show answer & explanation
Answer: A. K-ary tree

A K-ary tree is a generalized tree where each node can have up to K children, making it not restricted to binary (2 children). A binary tree specifically limits each node to at most 2 children. Heaps, expression trees, and threaded trees are all specialized implementations or variants of binary trees.

Step-by-step Derivation:
Binary trees have the fundamental property that each node has at most 2 children. Let's verify each option:

  1. K-ary tree: By definition, a K-ary tree allows each node to have up to K children. When K > 2, it is NOT a binary tree. When K = 2, it becomes a binary tree specifically. So K-ary is a broader category that generalizes binary trees.

  2. Heap: A heap is a complete binary tree that satisfies the heap property (min-heap or max-heap). It is always a binary tree.

  3. Expression tree: An expression tree represents mathematical or logical expressions using a binary tree structure where operators are internal nodes and operands are leaf nodes. It is a binary tree variant.

  4. Threaded tree: A threaded tree is a binary tree variant where unused pointers in leaf/semi-leaf nodes are reused to point to predecessor/successor nodes (in-order threading). It is still a binary tree.

Conclusion: K-ary tree is NOT a type of binary tree; rather, binary trees are a special case of K-ary trees (when K=2).