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

How can we specify file transfer in a web page, Can we specify file transfe...

Can we specify file transfer in a Web page? Explain with the help of suitable example. Yes, file transfer can be given in a web page. The first field within a URL gives a proto

Dbms, sketch a neat E-R diagram for hotel management system with real time ...

sketch a neat E-R diagram for hotel management system with real time example

Operation of micro-programmed control unit, Micro-instructions are stored i...

Micro-instructions are stored in control memory. Address register for control memory comprises the address of subsequent instruction which is to be read. Control memory Buffer Regi

Level of any node of a tree, Level of any node of a tree is :- Its distanc...

Level of any node of a tree is :- Its distance from the root

How many precision resistors requires a weighted resistor, A weighted resis...

A weighted resistor digital to analog converter using N bits requires a total of ? Ans. Digital to analog converter, a weighted resistor using N bits needs a total of N precisi

What is dom, DOM is the Document Object Model (DOM) which is an interface s...

DOM is the Document Object Model (DOM) which is an interface specification handled by the W3C DOM Workgroup that explains an application independent mechanism to access, parse, or

#title.sequential circuit, design modulo 12 up synchronous counter using t ...

design modulo 12 up synchronous counter using t flip flop

Explain about fundamental nature of a computer, Q. Explain about fundamenta...

Q. Explain about fundamental nature of a Computer? The fundamental nature of a Computer is as an information transformer. So a computer should be able to take input and process

What is remote login, Remote Login  A login that permits a user termina...

Remote Login  A login that permits a user terminal to connect to a host computer by a network or direct telecommunications link, and to interact with that host computer as if t

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