Data Structures · Question 14 · Hard

How many structurally different binary trees can be formed with exactly 3 nodes?

  1. 5
  2. 3
  3. 6
  4. 4
Answer and explanation

Answer: A. 5

Explanation: The count is the Catalan number C(3) = 6! / (4! × 3!) = 5: two left/right chains, two zig-zag shapes, and one balanced tree.

Previous: The keys 10, 4, 7, 1 are inserted in that order into an empty array-based… · Next: Two stacks share a single array arr[0..n-1]. Stack 1 starts at index 0 and…

Practise data structures

Try a fresh set of data structures questions with an explanation after every answer, free and without signing up: Data Structures practice. Or sit a full placement mock test.

More data structures questions

More technical & programming practice

Algorithms · Object-Oriented Programming · DBMS · SQL · Operating Systems · Computer Networks · Software Engineering · Cloud & DevOps

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge