Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

pesudcode with detail comment 1 Question 1. Suppose we need a data container for storing multiple distinct integers, and we need to frequently run the

pesudcode with detail comment

image text in transcribed
1 Question 1. Suppose we need a data container for storing multiple distinct integers, and we need to frequently run the following operations: . searching, insertion, and deletion . selection: identifying the i-th largest integer We decide to implement a binary search tree (just a normal binary search tree, not AVL), as binary search tree's average performance is quite good for searching, insertion, and deletion. Then, to make selection more efficient, we decide that our tree nodes will store three pieces of information (the value itself, plus two additional pieces of book-keeping information): . The integer value that we need to store . How many nodes are in the left child branch . How many nodes are in the right child branch We call our new data structure ADSA Binary Search Tree (ABST). Now you are asked to fill in the implementation details. We are looking for algorithms that are efficient and elegant. This is an open ended question without a specific standard answer. . Given an ABST, how to find the i-th largest integer? Please provide pseudocode. (2 marks: 1 for correctness and 1 for efficiency and elegance) . How to perform insertion to an ABST? Please provide pseudocode. Note that you need to maintain the correctness of all book-keeping information, i.e, for every node, you need to update how many nodes are in the child branches. (4 marks: 2 for correctness, 1 for efficiency, 1 for elegance) . How to perform deletion from an ABST? To make this problem easier, you only need to consider the case where the node to be deleted has only one child branch. Please provide pseudocode. (4 marks: 2 for correctness, 1 for efficiency, 1 for elegance)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Building customer relationships

Answered: 1 week ago