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

Find how many bits of adc are required to get an resolution, Find how many ...

Find how many bits of ADC are required to get an resolution of 0.5 mV if the maximum full scale voltage is 10 V Ans. Given Resolution=.5mV Full scale output=+10v %resolut

What is device drivers, A device driver is software interface that manages ...

A device driver is software interface that manages communication with and control of a particular I/O device or type of device. It is task of device driver to convert logical reque

Cache misses - computer architecture, Cache Misses Compulsory misse...

Cache Misses Compulsory misses -  it is caused by initial access to a block that has never been in the cache (also called cold start misses Capacity miss - it is cause

Strings made of left curly braces, In a logical system, a judgement is a st...

In a logical system, a judgement is a statement that is either true or false. So far, you are most familiar with the type of judgement "A is true", which is often simply abbreviate

What are the elements of an instruction, Q. What are the elements of an ins...

Q. What are the elements of an instruction? As the function of instruction is to communicate to CPU what to do it needs a minimum set of communication such as:  What op

What is clipboard, Clipboard is a temporary storage location in Windows. Th...

Clipboard is a temporary storage location in Windows. The clipart will kept one piece of information at a time when it is manually added to the clipart or is copied there.

Write an xpath expression, Question: (a) Explain the five different t...

Question: (a) Explain the five different types of element content defined by DTDs. (b) Compare XML schema's against DTDs. (c) Consider the following two element decla

Write a subroutine in c for toggling the cursor, Write a subroutine in C fo...

Write a subroutine in C for toggling the cursor using old directives. ; ; use small memory model for C - near code segment _DATA SEGMENT WORD   'DATA'   CURVAL EQU   [B

Purpose of storage - computer architecture, Purpose of storage: Several...

Purpose of storage: Several different forms of storage, based on different natural phenomena, have been invented.  So far, no practical universal storage medium persists, and a

What is pure virtual function, A class is made abstract by declaring one or...

A class is made abstract by declaring one or more of its virtual functions to be pure. A pure virtual function is one with an initializer of = 0 in its declaration

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