Questions tagged [linked-list]

A linked list is a data structure in which the elements contain references to the next (and optionally the previous) element.

Filter by
Sorted by
Tagged with
2
votes
1answer
562 views

Linked list operations for a competition

After checking some incoming coding competitions, I feel I may want to develop a little bit more on my coding skills and style using some basic algorithms/data structures. The following two pieces of ...
7
votes
2answers
859 views

Singly Linked List

I am a self taught programmer and, while I understand data structures at a theoretical level (as well as through optimizing my own code), I have never actually taken the time to write my own ...
8
votes
4answers
26k views

Doubly linked list in C++

Please, review the code: ...
4
votes
3answers
30k views

Circular linked list

Please review this: ...
4
votes
1answer
18k views

Linked List implementation in C++

I'm learning to implement linked list. I've implemented sorting with merge sort, reversing etc... LinkedList.cpp ...
3
votes
2answers
344 views

Criticize my Linked List implementation

I'd appreciate any and all criticism about this code. I didn't have a particular use case in mind when I wrote it; I just wanted to try implementing linked lists. My comments are not very useful, I ...
5
votes
4answers
17k views

Java Implementation of linked list add(i, x) method

I'm currently trying to brush up on ADT implementations, specifically an implementation for a Linked List (I'm using Java 5 to do this). Is this implementation I've written for ...
4
votes
4answers
390 views

Creating and reversing a linked list

Here is my program which creates a linked list and reverses it: ...
6
votes
1answer
406 views

Inserting into a linked list

I know that this is very very basic, but now I am starting from group up after getting frustrated with my coding practices and knowledge of standard idioms out there and elegant way of coding corner ...
10
votes
2answers
874 views

Remake of Java's doubly LinkedList

I've been learning to program in Java and I decided to implement a doubly linked list as practice and as a bridge project before going on to learn C++. I know Java includes a ...
6
votes
2answers
1k views

Flattening a doubly linked list

I am a Java dev and trying to prepare for interviews in C++. Can someone please review the below solution for me? Assume that you are given the head and tail pointers of a doubly linked list where ...
3
votes
1answer
40k views

Deleting a linked list node

This is a classic linked list problem. Deleting a node from linked list given the data to be deleted. Inserting a node in a sorted linked list. I saw various versions of this and here is my version. ...
9
votes
6answers
5k views

Linked List program

This is a simple linked list program which creates a list by appending an object at the tail. It compiles and runs perfectly. Is the coding style, logic etc are fine? How can I improve this program? ...
13
votes
6answers
43k views

C function to find and delete a node from a singly linked list

I'm looking for the most commonly used style for writing the delete_item() function of a singly linked list, that find a matching item and deletes it. Is what I ...

1
17 18 19 20
21