Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you use linked lists, doubly linked lists and so on, in business programming?

Are data structures like linked lists something that are purely academic for real programming or do you really use them? Are they things that are covered by generics so that you don't need to build them (assuming your language has generics)? I'm not debating the importance of understanding what they are, just the usage of them outside of academia. I ask from a front end web, backend database perspective. I'm sure someone somewhere builds these. I'm asking from my context.

Thank you.

EDIT: Are Generics so that you don't have to build linked lists and the like?

like image 931
johnny Avatar asked Jun 22 '09 14:06

johnny


People also ask

When would you use a doubly linked list?

Applications of Doubly Linked List: Doubly linked list can be used in navigation systems where both forward and backward traversal is required. It can be used to implement different tree data structures. It can be used to implement undo/redo operations.

Do programmers use linked lists?

Linked List Utility. Lists are one of the most popular and efficient data structures, with implementation in every programming language like C, C++, Python, Java, and C#. Apart from that, linked lists are a great way to learn how pointers work.

Which is better linked list or doubly linked list?

When we want to save memory and do not need to perform searching, we prefer a singly linked list. In case of better implementation, while searching, we prefer a doubly linked list. A singly linked list consumes less memory as compared to the doubly linked list.

What is a good reason to use doubly linked lists?

The most common reason to use a doubly linked list is because it is easier to implement than a singly linked list. While the code for the doubly linked implementation is a little longer than for the singly linked version, it tends to be a bit more “obvious” in its intention, and so easier to implement and debug.


1 Answers

It will depend on the language and frameworks you're using. Most modern languages and frameworks won't make you reinvent these wheels. Instead, they'll provide things like List<T> or HashTable.

EDIT:

We probably use linked lists all the time, but don't realize it. We don't have to write implementations of linked lists on our own, because the frameworks we use have already written them for us.

You may also be getting confused about "generics". You may be referring to generic list classes like List<T>. This is just the same as the non-generic class List, but where the element is always of type T. It is probably implemented as a linked list, but we don't have to care about that.

We also don't have to worry about allocation of physical memory, or how interrupts work, or how to create a file system. We have operating systems to do that for us. But we may be taught that information in school just the same.

like image 144
John Saunders Avatar answered Oct 07 '22 18:10

John Saunders