Monika posted an Question
January 30, 2022 • 22:46 pm 30 points
  • UGC NET
  • Computer Science & Applications

Exiy 1. a binary search tree contains the values 1, 2, 3, 4, 5, 6, 7, 8. the tree is traversed in pre-order and the val ues are printed out. which of the follo

exiy 1. A binary search tree contains the values 1, 2, 3, 4, 5, 6, 7, 8. The tree is traversed in pre-order and the val ues are printed out. Which of the following is a valid output? (A) 53124786 (C) 53241678 (B) 53126487 (D) 53124768 Cor RRK

1 Answer(s) Answer Now
  • 0 Likes
  • 1 Comments
  • 0 Shares
  • Aparna 1 best-answer

    Preorder means Root-Left-Right or Node-Left-Right(NLR) sequence of the traversal of elements. In Binary search tree, left sided elements are smaller then the root and right sided elements are greater than the root value.. So we will check all options given in the question. By checking all options as shown in attached file, the correct answer is Option D i.e. 53124768

    cropped9027903669209352784.jpg
    cropped4878982007784643799.jpg
whatsapp-btn

Do You Want Better RANK in Your Exam?

Start Your Preparations with Eduncle’s FREE Study Material

  • Updated Syllabus, Paper Pattern & Full Exam Details
  • Sample Theory of Most Important Topic
  • Model Test Paper with Detailed Solutions
  • Last 5 Years Question Papers & Answers