java 3 solve test question double linkedlist (Arabic)
Question 1 [8 + 8 Marks]
(A) [8 Marks] Write a method called insertSorted to be included in class LinkedList that accepts a parameter item of type E. Assume that the list is sorted in ascending order. The method will insert a new node in the list containing item as data in such a way that after insertion also the list remains sorted. Consider all possible cases in your method, including empty list.
Do not call any method of class LinkedList in your method.
Example :
Before run:
head
list: 5 10 20 30 35 50
item = 25 After run:
head
list: 5 10 20 25 30 35 50
Method heading:
public boolean insertSorted(E item)
{
//////////////////////////////////////////////////////////////////////////////////////////////////////////
(B) [8 Marks] Write a method called deleteMultipleNodes to be included in the class KWLinkedList (class for doubly linked list). The method has two parameters count of type int and direction of type char. The count is the number of nodes to be deleted in the specified direction. The direction can be either ‘f’ or ‘b’. The method returns false, if the list is empty or the number of nodes in the list is less than count. The method checks the direction, if direction is ‘f’, the method removes count number of nodes in the forward direction, otherwise, the method removes count number of nodes in the backward direction, and returns true.
NOTE: You can use ListIterator and its methods.
Example 1:
Before run:
head tail
list: 20 50 70 90 33 89
count: 2 direction: ’f’ After run:
head tail
list: 70 90 33 89
Example 2:
Before run:
head tail
list: 20 50 70 90 33 89
count: 2 direction: ’b’ After run:
head tail
list: 20 50 70 90
Method heading:
public boolean deleteMultipleNodes(int count, char direction)
{
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «java 3 solve test question double linkedlist (Arabic)», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.