Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a method to find predecessors and successors for student name given using binary search tree in java Problem description Ever since the return from

Write a method to find predecessors and successors for student name given using binary search tree in java
image text in transcribed
Problem description Ever since the return from the pandemic after Covid-19, the lecturers from a prestigious university have noticed that the students have boosted their cheating game in exams by planning beforehand with the students sitting in front and behind them. Hence, the lecturers have decided to create a new alphabetically sorted seating arrangement for each exam and only showing the arrangement 5 minutes before the exam. It is important to note that the number of students in a class is never fixed, and each exam has different students taking it. Which also means that each time for an exam, students can be removed or added from one exam to another and only release these names before each exam. In this way, the students would not know who is sitting in front of them or behind them before an exam; which reduces the chances of them planning their cheating process beforehand. However, the students are trying to outsmart the algorithm and determine how they can find the names quickly so they can strategize their cheating mechanism. Problem breakdown Consider a list of students where each student in the list has information (such as Name, ID, Major) assuming that the student's name is unique (no duplicates). Note that, you need to implement your own Student class. Your task is to implement a program that helps a given student to find the students X and Y, where X would be the student information behind the given student and Y is the information of the student in front of the given student considering that the students are seated in alphabetical order. This could be done very quickly as the students have limited time to figure out the arrangement and strategize before starting the exam. You are asked to implement this project twice, each with a different data structure in order to easily find out the names of students sitting before and after a given student in a test. One of your implementations must allow a list insertion and deletion of complexity of 0 (logn) in the general scenarios. Also, it's worth noting that the complexity of best sorting algorithm is O(nlogn)

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

Deductive And Object Oriented Databases Second International Conference Dood 91 Munich Germany December 18 1991 Proceedings Lncs 566

Authors: Claude Delobel ,Michael Kifer ,Yoshifumi Masunaga

1st Edition

3540550151, 978-3540550150

More Books

Students also viewed these Databases questions

Question

What are the ways by which ES justify their knowledge?

Answered: 1 week ago