Search in a BST

A binary search tree (BST) is a binary tree such that for each node n in the tree the elements in the left subtree of the tree rooted at n are less than the element at node n, and the elements of the right subtree of the tree rooted at n are greater than the element at the node n.

Write a program that first reads a binary tree of integer numbers in pre-order. The input binary tree will be always a BST. Then, the program reads a sequence of integer numbers, and for each number in the sequence determines whether the number is or not in the input BST.

Problem information

Author: Josefina Sierra Santibáñez

Generation: 2026-01-25T19:58:00.574Z

© Jutge.org, 2006–2026.
https://jutge.org