Top "Linked-list" questions

A linked list is a data structure where the list elements are not necessarily stored sequentially but rather each element contains a reference to the next (and optionally the previous) element in the list.

When to use LinkedList over ArrayList in Java?

I've always been one to simply use: List<String> names = new ArrayList<>(); I use the interface …

java arraylist collections linked-list
Python Linked List

What's the easiest way to use a linked list in python? In scheme, a linked list is defined simply by …

python linked-list
How to reverse a singly linked list using only two pointers?

I wonder if there exists some logic to reverse a singly-linked list using only two pointers. The following is used …

c algorithm data-structures linked-list singly-linked-list
Array versus linked-list

Why would someone want to use a linked-list over an array? Coding a linked-list is, no doubt, a bit more …

arrays data-structures linked-list language-agnostic
When to use a linked list over an array/array list?

I use a lot of lists and arrays but I have yet to come across a scenario in which the …

arrays list arraylist linked-list
Creating a very simple linked list

I am trying to create a linked list just to see if I can, and I am having trouble getting …

c# linked-list
Reversing a linked list in Java, recursively

I have been working on a Java project for a class for a while now. It is an implementation of …

java data-structures recursion linked-list
How to detect a loop in a linked list?

Say you have a linked list structure in Java. It's made up of Nodes: class Node { Node next; // some user …

java algorithm data-structures linked-list