RUVIDEO
Поделитесь видео 🙏

Doubly Linked List Java assignment (part 3, Doubly class delete) | Data Struct. & Algorithm Analysi

📁 Обучение 👁️ 16 📅 05.12.2023

More Data Structures and Algorithm Analysis videos:
https://youtube.com/playlist?list=PLZPy7sbFuWViIs2tnMRzkr6-1Pr2I3o3o
(Infix to Postfix videos in playlist)

Notes for Data Structures and Algorithm Analysis:
https://docs.google.com/document/d/1YU8wUtH0_bOHlAM1MqOAbxnZhQQBJ0yHYA-lNPafgkM/edit?usp=sharing


Assignment Instructions:
Write a program that reads a list of students (first names only) from a file. It is possible for the names to be in unsorted order in the file but they have to be placed in sorted order within the linked list.

The program should use a doubly linked list.

Each node in the doubly linked list should have the student’s name, a pointer to the next student, and a pointer to the previous student. Here is a sample visual. The head points to the beginning of the list. The tail points to the end of the list.

When inserting consider all the following conditions:

if(!head){ //no other nodes
}else if (strcmp(data, head-} name) { 0){ //smaller than head
}else if (strcmp(data, tail-} name) } 0){ //larger than tail
}else{ //somewhere in the middle
}

When deleting a student consider all the following conditions:
student may be at the head, the tail or in the middle


Below, you will find a sample of what the file looks like. Notice the names are in unsorted order but the information placed in the linked list (above visual) is in sorted order. The name of the file should be “input.txt”.

In the text file, the word delete followed by a name, should delete the node with that specific student’s name from the doubly linked list. If the name is not found, then nothing is deleted.

(NOTE: The above visual represents only the first three lines from the text file below.)

Jim
jill
John
delete jill
Bob
Jack
delete jim

At the end of the program, traverse through the contents of the linked list in both ascending and descending order, using the doubly linked list, and write the contents into the file output.txt. For example, given the above list, here is the sample display:

Bob
Jack
John
=============
John
Jack
Bob



Here is a Q&A link to some of your possible questions. Please email me any further questions and I will update the google document with some helpful hints.
-----
https://docs.google.com/document/d/1FEX_RshlEqc1Judd6eD_JZqIuHNjylPapH1PuDZ_tr8/edit?usp=sharing

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Doubly Linked List Java assignment (part 3, Doubly class delete) | Data Struct. & Algorithm Analysi», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.