Skip to main content

All Questions

Filter by
Sorted by
Tagged with
6 votes
3 answers
471 views

Unit testing a Linked List implementation in C++

Recently I wanted to use the gtest library to unit test my program but for some reason, it's incredibly hard to make it work and configure (at least for me it was), ...
I_throw_but_dont_catch's user avatar
3 votes
1 answer
106 views

A singly linked list implementation

Here's yet another implementation of a singly linked list. You may base your review on the following questions: Review goals: Is the API well thought of? Does this design include undefined behavior, ...
Harith's user avatar
  • 9,777
0 votes
1 answer
57 views

Faster, indexed, heuristic doubly-linked list data structure in Java: unit tests

Here I have the unit tests for the indexed doubly-linked list. It goes like this: ...
coderodde's user avatar
  • 29.8k
2 votes
1 answer
822 views

A simple priority queue in Java via linked list sorted by priority keys

Now I have this very simple priority queue. add and changePriority both run in \$\mathcal{O}(n)\$ and ...
coderodde's user avatar
  • 29.8k
2 votes
1 answer
663 views

Linked list implementation along with unit test - Round 3

Here are the changes I've made thanks to suggestions made by @vnp, and @Henrik Hansen. Here is the link to the previous code review: Linked list implementation along with unit test - Round 2 I've ...
feature_creep's user avatar
4 votes
2 answers
276 views

Linked list implementation along with unit test - Round 2

Here is the link to the next round of code review: Linked list implementation along with unit test [Round 3] Here's the link to the previous code review: Linked list implementation along with unit ...
feature_creep's user avatar
8 votes
1 answer
4k views

Linked list implementation along with unit test

I've already made all the changes suggested here. Here is the link for round 2: Linked list implementation along with unit test [Round 2] I want to see how other people think of my code, so here it ...
feature_creep's user avatar
5 votes
2 answers
486 views

LinkedList class implementation in Python

I was solving this problem for implementing LinkedList and ListNode classes, and Insert and <...
NinjaG's user avatar
  • 2,489
5 votes
2 answers
1k views

Remove the first value for a doubly linked list

You need to remove the first element which contains a given value from a doubly linked list. I created two solutions since I find the edge case of removing the first element to be problematic. So I ...
Gilad's user avatar
  • 5,253
3 votes
1 answer
2k views

Linked list implementation in Clojure

Background Linked lists are a well-known data structure, so I won't waste too much detail on them. Suffice to say that a linked list consists of "cells". Each cell contains some kind of value and a ...
Attilio's user avatar
  • 1,645
3 votes
1 answer
1k views

Python Hash Table and insertion

I'm attempting to implement a basic hash table in Python using linked lists. Any tips would be appreciated (including better hash functions). I intend this to handle collisions with separate chaining. ...
NinjaG's user avatar
  • 2,489
2 votes
1 answer
2k views

Python implementation as single linked list class `replace item` with item

I encountered this question as I am preparing for my code interview. I was implementing my linked list implementation. I would like to ask for the following implementation: Replace item with item ...
NinjaG's user avatar
  • 2,489
2 votes
1 answer
261 views

Singly linked list data structure design, implementation and unit testing

Design a singly linked list data structure that supports following operations: size, is_empty, ...
Balaji's user avatar
  • 29
2 votes
3 answers
6k views

Queue implementation using linked list

I have implemented a queue data structure using linked list in C#. I have also associated my implementation with unit tests. Is this implementation correct? Any suggestion? ...
Joan Dimko's user avatar
3 votes
1 answer
2k views

Doubly-linked list implementation in Python with unit-tests

I am soliciting some feedback on my doubly-linked list implementation. In particular, I am looking for your take on my unit-tests and their coverage of the code itself. That is, I developed this class ...
MadPhysicist's user avatar
8 votes
1 answer
2k views

Python Singly Linked List Implementation

This is a follow-up to a question I asked a few days ago. I incorporated many of the suggestions on how to make the code more standardized and Python-like. If you see something else that can be ...
MadPhysicist's user avatar
3 votes
2 answers
7k views

Python Linked List implementation

I am looking for some comments on an implementation of a singly-linked list in Python. What could I do to make it more reliable and readable? ...
MadPhysicist's user avatar
5 votes
1 answer
220 views

Swap items of a linked list in pairs - revision 5

Here is the source of the question. Given a singly linked list, swap the list items in pairs (reconnect the pointers, not simply swap the values). For example: Before: A->B->C->D After: ...
Maksim Dmitriev's user avatar
1 vote
1 answer
97 views

Swap items of a linked list in pairs - revision 4

Here is the source of the question. The solution on GitHub. Revision 1. Revision 2. Revision 3. @200_success' suggestions from revision 3: The iterator's ...
Maksim Dmitriev's user avatar
2 votes
1 answer
84 views

Swap items of a linked list in pairs - revision 3

Here is the source of the question. Revision 1. Revision 2. When I started the second round of code review, I wanted to make sure that I had included all the possible input types. However, I ...
Maksim Dmitriev's user avatar
3 votes
1 answer
176 views

Swap items of a linked list in pairs - revision 2

The first revision is available here and the code is available on GitHub. I modified the method reversePairs and added mSize to ...
Maksim Dmitriev's user avatar
12 votes
3 answers
7k views

Unit testing with a singly linked list

To hone my skills with C++11, I'm implementing a singly-linked list based on the requirements I found at this link. I've implemented code that supports the following subset of requirements from the ...
Steve's user avatar
  • 293
4 votes
2 answers
4k views

Singly-linked list library

This is sort of a follow-up to a post I created about 10 days ago, but I have completed the implementation: Designing function prototypes for a singly-linked list API in C. As I began to work on the ...
oddlogic's user avatar
3 votes
2 answers
1k views

Generic Linked List Implementation in Java

I am looking for feedback on my doubly linked list implementation that I have written in Java. I am looking for specific feedback on the efficiency of my code, as well as my usage of generics. I am ...
mabufo's user avatar
  • 301
7 votes
2 answers
875 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 ...
Noobster's user avatar