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.

Linked Lists in C without malloc

#include <stdio.h> typedef struct node { int i; struct node *next; }node; node getnode(int a) { struct node …

c malloc linked-list
Is HashMap internally implemented in Java using LinkedList or Array?

How is HashMap internally implemented? I read somewhere that it uses LinkedList while other places it mentions Arrays. I tried …

java arrays linked-list hashmap hashset
Why is mergesort space complexity O(log(n)) with linked lists?

Mergesort on an array has space complexity of O(n), while mergesort on a linked list has space complexity of …

arrays algorithm sorting linked-list
Difference in LinkedList, queue vs list

What is the difference when creating these two objects Queue<String> test = new LinkedList<String>(); and …

java list data-structures linked-list queue
how to remove a object from linked list in java?

i have one problem with my code ,i did a sample program to display the emp details from a linked …

java data-structures linked-list singly-linked-list
Is there a linked list predefined library in Python?

I know in c++ it already exist #include <list> Now I am curious to know if it exist …

python linked-list singly-linked-list
why LinkedList doesn't have initialCapacity in java?

I wonder why LinkedList doesn't have initialCapacity. I know good when to use ArrayList and when LinkedList. Its good practice …

java arrays arraylist collections linked-list
Head node in linked lists

I have problems with understanding what is the nature of the first node, or the so called head, in a …

java linked-list head
Best algorithm to test if a linked list has a cycle

What's the best (halting) algorithm for determining if a linked list has a cycle in it? [Edit] Analysis of asymptotic …

algorithm data-structures linked-list
Why increase pointer by two while finding loop in linked list, why not 3,4,5?

I had a look at question already which talk about algorithm to find loop in a linked list. I have …

algorithm data-structures linked-list cycle floyd-cycle-finding