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

Illustration of equivalent exe program, Q. Illustration of equivalent EXE p...

Q. Illustration of equivalent EXE program? An illustration of equivalent EXE program for COM program is: ; ABSTRACT this program adds 2 8-bit numbers in the memory locations

Explain working of counters, Q. Explain working of Counters? A counter ...

Q. Explain working of Counters? A counter is a register that goes through a predetermined sequence of states when clock pulse is applied. In principle value of counters is incr

Centres of keycaps, A full size keyboard has distance between centres of ke...

A full size keyboard has distance between centres of keycaps (keys) like 19mm (0.75in).The keycaps have a top of nearly 0.5in (12.5in) that is shaped as a sort of dish to help you

Micooperation, please suggest me ,how to write microopertions,and study for...

please suggest me ,how to write microopertions,and study for computer architecture

Communication of request/response - procedural interaction, Explain the Com...

Explain the Communications of Request/Response Communications requirements for message or procedural- based interaction are very similar. Application interaction (client-server

Why timing signal distributor required, Q. Why Timing Signal Distributor r...

Q. Why Timing Signal Distributor required? What do you mean by Memory Cycle? How many Memory Cycles required for following instructions: 1. ADD 2. CLEAR and ADD 3. DC

E-commerce in the market, Considering the fact that a lot of research has b...

Considering the fact that a lot of research has been done concerning e-commerce, what has been brought in this work is that there has been a lot of facts, studies, and experiments.

Why is xml superior to other forms of data exchange, Why is XML superior to...

Why is XML superior to other forms of data exchange? The XML gives universal data format for integrated electronic business solutions. Other database systems and Relational dat

Define modem, Define Modem. A modem changes digital signals into audio ...

Define Modem. A modem changes digital signals into audio tones to be transmitted over telephone lines and also changes audio tones from the lines in digitals signals for machin

Micro processor code, Suppose that the working register W contains the valu...

Suppose that the working register W contains the value 0x4F, the register FSR contains the value 0x2B; the register with address 0x2B contains 0x2F and the instruction ADDWF INDF,

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