Lab Task Binary Search Tree
Lab Task Binary Search Tree
Faculty of Computing
Lab Task # 1:
Write a program of binary tree using linked list for objects of “person” class. Attributes of
“person” class (privately defined) are per_id (int), per_name (string) and per_age (int). “person”
class contains member functions (publicly defined): constructor, input and output functions. You
are required to define two more classes: one of these classes should define the node
implementation of linked list for objects of “person” class. Other class should define the binary
tree implementation for objects of “person” class, this class should contain the member
functions like insert, search, delete, pre order, and post order and in order traversals of binary
tree.
Lab Task # 2:
Write a program which should implement a binary tree using linked list. Elements of tree are
objects of “student” class. “student” class contains attributes (privately defined) reg_no(int),
st_name (string) and cgpa (float). “student” class should also contain member functions (publicly
defined); constructor, input and output functions. User will insert objects of class “student” in
binary tree, values of attributes of objects will be provided by user. Program should display the
objects of student class in pre order, post order and in order traversal formats. Program should
also search an object from tree which is provided by user as input.