0

For homework I had to create a doubly linked list and make a small application that uses the data structure. Previously I had a similar homework with a Stack data structure, so I created a parenthesis matching app.

Can anyone suggest me a small app that could use a doubly linked list and that it shows how its better to use a doubly linked list over a single linked list.

Thanks

Kevjumba94
  • 19
  • 2
  • Have a look at [this](http://stackoverflow.com/questions/15563043/when-is-doubly-linked-list-more-efficient-than-singly-linked-list) SO article which does a good job of discussing the differences between single- and doubly-linked lists. – Tim Biegeleisen Mar 10 '15 at 03:28

2 Answers2

3

Think of the Back - Forward buttons of your web browser. The browser keeps a history of the links you have visited in a doubly linked list.

Tristan
  • 31
  • 2
0

Make an application that stores names and phone numbers (as one example) and then give it the capability to output them in both ascending and descending order (based on name).

While a singly linked list would be efficient in one direction, the doubly linked version would be efficient in both.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953