GATE Exam  >  GATE Questions  >  Consider the following BST.Its pre-order and ... Start Learning for Free
Consider the following BST.
Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?
  • a)
    4
  • b)
    5
  • c)
    6
  • d)
    7
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
Consider the following BST.Its pre-order and post-order are inserted i...
(A) is the correct answer.
A Pre-order traversal visits nodes in the following order:
25, 15, 10, 4, 12, 22, 18, 24, 50, 35, 31, 44, 70, 66, 90
A Post-order traversal visits nodes in the following order:
4, 12, 10, 18, 24, 22, 15, 31, 44, 35, 66, 90, 70, 50, 25
Hence 4 elements are having same index numbers in both the arrays.
View all questions of this test
Explore Courses for GATE exam

Similar GATE Doubts

Consider the following BST.Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?a)4b)5c)6d)7Correct answer is option 'A'. Can you explain this answer?
Question Description
Consider the following BST.Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?a)4b)5c)6d)7Correct answer is option 'A'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Consider the following BST.Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?a)4b)5c)6d)7Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider the following BST.Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?a)4b)5c)6d)7Correct answer is option 'A'. Can you explain this answer?.
Solutions for Consider the following BST.Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?a)4b)5c)6d)7Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Consider the following BST.Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?a)4b)5c)6d)7Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the following BST.Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?a)4b)5c)6d)7Correct answer is option 'A'. Can you explain this answer?, a detailed solution for Consider the following BST.Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?a)4b)5c)6d)7Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of Consider the following BST.Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?a)4b)5c)6d)7Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the following BST.Its pre-order and post-order are inserted in two separate arrays(arrays having same starting index) of same size in traversal sequence. How many elements will have same index numbers in the both the arrays?a)4b)5c)6d)7Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev