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

Pythagorean theorem, if the 6 is a and the b is 3 what is the c ?

if the 6 is a and the b is 3 what is the c ?

Simplified boolean expression, Simplified the Boolean Algebra (x + y)(x + z...

Simplified the Boolean Algebra (x + y)(x + z) simplifies to ? Ans. x + yz as simplified the Boolean Algebra expression. [(x + y) (x + z)] = xx + xz + xy + yz = x + xz + xy + y

What is time out mechanism, What is time out mechanism. If one unit is ...

What is time out mechanism. If one unit is faulty the data transfer will not be done. Such an error can be detected using time out mechanism which makes an alarm if the data tr

What are the advantages offered by data mining, What are the advantages off...

What are the advantages offered by data mining? Advantages offered through Data Mining are given below: a) Facilitates discovery of knowledge through massive, large data set

De moiver theorem, application of de moiver theorem in software engineering...

application of de moiver theorem in software engineering

What are the role of an operating system, What are the role of an operating...

What are the role of an operating system? Sharing the Processor Virtual Machine: Resource management: Memory Management

Pipeline, where can I find detailed explanation of 6 stage and 7 stage pipe...

where can I find detailed explanation of 6 stage and 7 stage pipeline ??

Explain what is a macro and why is it important, Question 1: Spreadshee...

Question 1: Spreadsheet packages are widely used in Business. a) Explain why spreadsheets are so useful. b) Spreadsheet files are sometimes saved for use by other software p

How do you create a permanent cookie, How do you create a permanent cookie?...

How do you create a permanent cookie?  By setting the expiry date of the cookie to a later on time (like 10 years later.)

Differentiate between compiler and interpreter, (i) Compiler and Interpret...

(i) Compiler and Interpreter: These are two types of language translators. A compiler changes the source program (user-written program) into an object code (machine language b

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