Doubly linked list, Computer Engineering

Assignment Help:

A doubly linked list is like a linked list except that each node has a pointer both to the next node in the list and to the previous node in the list. There are also pointers to the two ends of the lists, called for example Left and Right. The values should be stored in order with the least value at the left and the greatest value at the right. Thus a list with 4 nodes containing the data 3,6,7,10 should look like this:

800_Doubly linked list.png

Write a class which will store a doubly linked list of integers (or another type if you prefer) in order, and which will allow the following operations:

1. A constructor and a destructor.

2. Insert a new element chosen by the user at the correct place in the list; for example inserting 8 in the list above will give the list 3, 6, 7, 8, 10.

3. Delete a data element chosen (by value) by the user, for example deleting 6 from the list above will leave 3, 7, 10.

4. List elements from left to right (i.e. in ascending order).

5. List elements from right to left (i.e. in descending order).

You should also write a suitable main program to allow comprehensive testing of the class and its operations.


Related Discussions:- Doubly linked list

Explain 100 line exchange with selector finder, Explain 100 line exchange w...

Explain 100 line exchange with selector finder. Design: In place of 100 two-motion selectors as in the case of Design 3, suppose we consider only 24 two-motion selectors. Whe

NETWORK ADMIN, Discuss the risks of having a single root user and how more ...

Discuss the risks of having a single root user and how more limited management abilities can be given to others users on Linux/UNIX systems.uestion #Minimum 100 words accepted#

Quiz help, which two class die class contain in computer programing.

which two class die class contain in computer programing.

Assignment, what are the different techniques of biasing a transistor?

what are the different techniques of biasing a transistor?

Linux, Explain about unix file system architecture

Explain about unix file system architecture

4 variable k-maps, 4-variable K-maps have 16 squares which arearranged in 4...

4-variable K-maps have 16 squares which arearranged in 4 columns and 4 rows.  Columns and rows are labeled with 2 variables. The rows are arranged so that C or D ch

Java, about java types

about java types

What is the need of interrupt controller, What is the need of interrupt con...

What is the need of interrupt controller?  The interrupt controller is employed to expand the interrupt inputs. It can handle the interrupt requests from several devices and pe

I have a user defined function that does not recalculate, Contain all the c...

Contain all the cells that your UDF depends on in the argument list. Or enter this as the first statement in your Function: Application.Volatile This will cause the functi

Combinatorial and scheduling problems, Combinatorial and Scheduling Proble...

Combinatorial and Scheduling Problems: One class of problems is concerned with specifying optimal scheduled. A classical example is the Travelling Salesperson Problem where

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd