[SOLVED] CSE100 Algorithm Design and Analysis    Lab 11,

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

Binary Search Trees

In this lab your goal is to implement standard operations on binary search trees, including insert and delete. See section 12.3 in the textbook. In this assignment the keys are integers.

The input contains one of the following commands on a line:

  • i key — Insert key into the BST. For example, “i 2” means “Insert key 2 into the BST”.
  • d key — Delete key from the BST. For example, “d 2” means “Delete key 2 from the BST”. Do nothing if the BST does not contain the key.
  • pre — Output all keys in preorder.
  • post — Output all keys in postorder.
  • in — Output all keys in inorder.
  • e — Finish your program.
Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.