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.

double free or corruption (fasttop)

The following section of my code gives me this messege when executing * glibc detected ./a.out: double free or corruption (…

c linked-list coredump double-free
ArrayList Vs LinkedList

I was following a previous post on this that says: For LinkedList get is O(n) add is O(1) remove …

java data-structures collections arraylist linked-list
Why is ArrayDeque better than LinkedList

I am trying to to understand why Java's ArrayDeque is better than Java's LinkedList as they both implement Deque interface. …

java deque linked-list arraydeque
Finding loop in a singly linked-list

How can I detect that whether a singly linked-list has loop or not?? If it has loop then how to …

linked-list
Relative performance of std::vector vs. std::list vs. std::slist?

For a simple linked list in which random access to list elements is not a requirement, are there any significant …

c++ data-structures stl performance linked-list
How do I add objects into a linked list?

I have been working on a project where I must implement a java class that implements the use of doubly …

java linked-list doubly-linked-list
LinkedList - How to free the memory allocated using malloc

I have a very simple C code for constructing a Singly Linked list as below, in which I allocate memory …

c linked-list malloc free
Reversing a linkedlist recursively in c

The following code works fine when head is sent as a parameter to it. As I am new to C, …

c recursion linked-list singly-linked-list
Sorting a linked list in C

I'm trying to sort a linked list by finding the largest value, deleting it from its position, and then inserting …

c sorting linked-list singly-linked-list
What is the reason for using a double pointer when adding a node in a linked list?

The two code examples below both add a node at the top of a linked list. But whereas the first …

c pointers linked-list