Write pseudo-code not Python for problems requiring code. You are responsible for the appropriate level of detail. The questions in this assignment give you the opportunity to explore a new data structure and to experiment with the hybrid implementation in Q3. 1. A deque (pronounced deck) is an ordered set of items from which items may be deleted at either end and into which items may be inserted at either end. Call the two ends left and right. This is an access-restricted structure since no insertions or deletions can happen other than at the ends. Implement the deque as a doubly-linked list (not circular, no header). Write InsertLeft and DeleteRight. 2. Implement a deque from problem 1 as a doubly-linked circular list with a header. Write InsertRight and DeleteLeft. 3. Write a set of routines for implementing several stacks and queues within a single array. Hint: Look at the lecture material on the hybrid implementation.
Types of Linked List
A sequence of data elements connected through links is called a linked list (LL). The elements of a linked list are nodes containing data and a reference to the next node in the list. In a linked list, the elements are stored in a non-contiguous manner and the linear order in maintained by means of a pointer associated with each node in the list which is used to point to the subsequent node in the list.
Linked List
When a set of items is organized sequentially, it is termed as list. Linked list is a list whose order is given by links from one item to the next. It contains a link to the structure containing the next item so we can say that it is a completely different way to represent a list. In linked list, each structure of the list is known as node and it consists of two fields (one for containing the item and other one is for containing the next item address).
Assignment 6 - More on Lists
Write pseudo-code not Python for problems requiring code. You are responsible for the
appropriate level of detail.
The questions in this assignment give you the opportunity to explore a new data structure
and to experiment with the hybrid implementation in Q3.
1. A deque (pronounced deck) is an ordered set of items from which items may be deleted at
either end and into which items may be inserted at either end. Call the two ends left and right.
This is an access-restricted structure since no insertions or deletions can happen other than at the
ends. Implement the deque as a doubly-linked list (not circular, no header). Write InsertLeft and
DeleteRight.
2. Implement a deque from problem 1 as a doubly-linked circular list with a header. Write
InsertRight and DeleteLeft.
3. Write a set of routines for implementing several stacks and queues within a single array.
Hint: Look at the lecture material on the hybrid implementation.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps