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

learn more… | top users | synonyms

2
votes
1answer
33 views

Implementation of the undef function

Write a function undef that will remove a name and a definition from the maintained by lookup and ...
10
votes
3answers
124 views

LinkedList implementation implementing the List interface in Java

So here it is, my linked-list implementation in Java. I have coded against Java's List<E> interface as if my ...
9
votes
1answer
157 views

Bubble Sort in C: Array vs Linked List

A few weeks ago I posted a code review of a linked list so I decided to implement bubble sort on my journey of learning C. Here is the referenced linked list library, though this isn't really what's ...
4
votes
2answers
127 views

Singly linked list implementation

I feel like there is room for improvement in the push/pop methods. Any suggestions? ...
4
votes
2answers
102 views

3-class linked list

I am trying to make a linked list using 3 classes, however I cannot find ANY information online about it, and I can't seem to figure it out myself. If you could please correct and explain what I am ...
7
votes
1answer
96 views

Linked List reversal

Recursive version. The only interesting function: The original version: ...
13
votes
0answers
87 views

Stack Implemented Using Linked List

I wrote a stack implementation using a singly linked list in x86_64 assembly. This stack supports the usual push/pop operations as well as first/next for iterating over each element. I'm looking for ...
8
votes
0answers
52 views

Linux NASM assembly linked list implementation

Inspired by all of the lovely linked lists lately, I decided to implement one in assembly language. This code maintains two linked lists - one is a free store and the other is the active linked list. ...
5
votes
3answers
302 views

Singly-linked grocery list

For my own linked list implementation, I've decided to try something different: a linked list of groceries. The main differences between this implementation and a standard list are: more data ...
4
votes
1answer
83 views

Passing Node objects into insert routine of linked list

I've created a linked list class in Python, but I'm not sure how to enforce only passing Node objects into the insert routine. ...
10
votes
6answers
527 views

In-place reversal of a singly linked list

As suggested in The 2nd Monitor, I'd like a review of this in-place reversal of a singly linked-list: ...
4
votes
5answers
158 views

Validating that all Open/Close Parentheses are correctly matched

It returns true for: a*(b+c) ()() (()) ((!!(123(x)))) and returns false for (a((b+c)) )()( ))(( (rsd+3)*(-3-a)) ...
4
votes
1answer
60 views

Creating a list using a struct in C

I just got into structs and I decided to create a list using them: ...
10
votes
3answers
156 views

Simple Linked List

I've implemented a simple linked list in C# using generic T for values. I did not inherit from any of .Net's fun and helpful classes like ...
5
votes
3answers
146 views

Adding two BigIntegers by putting mutiple digits in a linked list

Based on feedback on an earlier question, I decided to implement the addition of two big ints by putting multiple digits in a node of a linked list. Can somebody take a look at my code and let me know ...
1
vote
1answer
88 views

Even and odd numbers in linked list [closed]

I have a linked list that stores integers. I must split the linked list into two linked list, one stores the even numbers and the other store the odd numbers. When I compile, it prints just the ...
5
votes
2answers
133 views

Adding two BigInts using linked lists in C

While trying to learn more about linked lists, I thought I should try the exercise of reading two BigInts from an input file and then adding them up. My strategy was to store the two numbers in two ...
5
votes
1answer
75 views

Linked List implementation and manipulations in C

While trying to learn some more C, I decided to implement a linked list and perform a few operations on it. The first thing I wanted to do was read from a .csv of numbers (ex: 1,2,3,...) and store ...
6
votes
4answers
476 views
6
votes
2answers
152 views

STL-compliant list class

Well, this is my first attempt to create a STL-compliant container. I'd like to know whether it meets STL concepts & requirements, so feel free to critique. .h link - ...
4
votes
4answers
594 views

Make LinkedList in C++ more clean

I have been working on a linked list for some while now and started out with this. Is my code clean? Or is there some way to make it better and more readable? The reason for this question is for me ...
12
votes
3answers
233 views

Reversing k-sized sequences in a linked-list

Here is my solution to this problem; please be brutally honest/strict, if I would have written this code, in a 45 minute interview, what would you think? (I am aiming for Google,Facebook). Here is ...
7
votes
2answers
192 views

Counting number of nodes between two nodes

This code counts the number of nodes between any given two nodes in a circular linked list. Any feedback is appreciated: ...
4
votes
3answers
161 views
11
votes
2answers
615 views

LinkedList with Node implementation

Below is my implementation of templated Node and LinkedList classes. I would really appreciate it if someone would give me ...
5
votes
2answers
116 views

Linked list implementation in C

I'm learning C for mainly for fun and to get a better understanding of how things work under the hood (most of my experience lies with high-level languages). I've been following quite a few books and ...
6
votes
1answer
52 views

Monadic Immutable Linked List in the Least Functional Language Evar

I've written a List monad as an example for a related question. This is a rather frustrating experience as I wanted to use Java, which (as of Java 7) still lacks lambda expressions and lacks ...
12
votes
4answers
965 views

Is this a proper doubly linked list?

I am currently in a data-structures class. The professor will be providing a singly linked list. I wanted to make a doubly linked list to "learn" how to do it. I tested it and I think it works. After ...
6
votes
2answers
162 views

Is this the right way for creating objects and putting them into std::list?

I am writing small roguelike game where I spawn some items and put them into the std::list - is this the right way to do it ? The Item class is as followed (I know it has public "id" property): ...
4
votes
2answers
98 views

Optimising LinkedList class - Part 2

This is part 2. My problems are with too any pointers and with long body code in the following functions: ...
3
votes
2answers
87 views

Optimising a LinkedList data structure - Part 1

I have implemented a linked list. I feel I overdid it with pointers, used old standards and C++11, and I ended with too many lines of code. I will make my quotations into two parts: one for the ...
10
votes
2answers
276 views

Linked list arithmetic

I am practicing for interviews and I tried solving the problem on my own and got a solution. I was wondering how can I improve the performance and memory on this program? The problem performs ...
2
votes
2answers
363 views

Creating linked list data with iterator pattern

I've created a linked list to use it in SquareList. I've started to create a linked list based on just that. I want my class to follow the iterator pattern. How can it be improve to use vector ...
1
vote
1answer
66 views

Copy a linkedlist with an arbitrary pointer

The full question description is found http://www.geeksforgeeks.org/a-linked-list-with-next-and-arbit-pointer/. Looking for code review, optimization, clean code etc. ...
4
votes
2answers
170 views

Singly linked list implementation

I am new to studying data structures although I have been programming in Java/Android since October. I feel it's time to advance, so I am starting data structures / algorithms this month. Since linked ...
4
votes
2answers
80 views

Delete duplicates in a linked List [closed]

I am reading Cracking the Code Interview and I am getting a bit confused at the bit using 'previous'. In this problem, the method deletes duplicate nodes in a Linked List. My assumption is that ...
3
votes
1answer
133 views

Reversing a singly-linked List

Is this the best way to reverse a singly-linked list? Can it be done with two, or fewer pointers? Any other comments? ...
4
votes
1answer
84 views
3
votes
1answer
165 views

Removing a link from a linked list

I have written a method for removing a link from a linked list for a phonebook project I'm currently working on and it works perfectly. However, I want to know whether or not my code is acceptable ...
1
vote
0answers
81 views

Multi producer/consumers lockfree list

As per similar question Multi producer/consumers lockfree stack, following a lockfree list implementation. Note that this list is pre-defined maximum set of elements which can be inserted (N argument ...
6
votes
2answers
108 views

Linked list implementation

I wrote some code for linked lists and would like to know what things could/should be done differently. I'm using an index to keep track of the most important information and have 2 sets of ...
10
votes
3answers
161 views

Please review my C code for a double linked list. Are there memory leaks I'm not seeing?

I've run my code through Valgrind and managed to not get any memory leaks based on the test code in main. I'm looking for things that I may not have thought to check for, and ways to improve my code ...
11
votes
3answers
1k views

Is this a properly implemented linked list class?

The code below is a class implementation of a linked list. I DO have concerns. For example, is it normal for the class to have at least one node? In other words, this implementation cannot have an ...
3
votes
1answer
236 views

Linked List Delete Node Function

This code is supposed to delete every node from a linked list with a given value. Are there any logical errors with this implementation? Did I do anything wrong or is there an area of this ...
6
votes
1answer
112 views

Better or more idiomatic way to apply a sequence of functions in Haskell

This is one of my Haskell solutions to a variation of the N-Queens problem, where the queens can move like knights in addition to their normal moves. It has been optimized somewhat to avoid ...
5
votes
2answers
284 views

Implementation of a double linked list with generics and inheritance

Disclaimer: The code already was graded - so I don't ask for a homework here -just for a code review. :) For a university course my colleagues and I had to implement a list without using any Arrays ...
0
votes
1answer
48 views
2
votes
3answers
398 views

Doubly linked list implementation in C

I'm quite new to C, and I'm looking for feedback on this (doubly) linked list code. Once I get to the add and remove methods, I feel like the code goes downhill. I'm looking for any potential errors ...
3
votes
4answers
702 views

Reviewing my implementation of a stack using linked list

I have been studying data structures, and I'm new to this. Here is my code for the push and pop operations. I considered using a node=top, so that I can avoid O(n) operations for the push (i.e. ...