Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

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
5 votes
4 answers
780 views

This is a reservations app with linked lists for insertion and BST for search. It uses CSV files for storage, recursion for printing and handles memory allocation for variable growth. I'm looking for ...
Attila Vajda's user avatar
1 vote
0 answers
29 views

Intro This post is the continuation of IndexedLinkedList.java - A fast list data structure for large data, Take III/V (private API). Code ...
coderodde's user avatar
  • 32.2k
1 vote
0 answers
30 views

Intro This post is the continuation of IndexedLinkedList.java - A fast list data structure for large data, Take II/V (package private API). It presents the private methods only. Code ...
coderodde's user avatar
  • 32.2k
1 vote
0 answers
33 views

Intro This post is the continuation of the IndexedLinkedList series. It presents the package private API: Code ...
coderodde's user avatar
  • 32.2k
1 vote
1 answer
80 views

Intro I have this Java implementation of a list data structure that outperforms on a benchmark even the Apache Commons Collection4 TreeList by a factor of 8. This ...
coderodde's user avatar
  • 32.2k
7 votes
7 answers
2k views

Is my logic good? Are variable names fitting? Are there any memory leaks? Am I doing anything dangerous (this is C after all)? Please feel free to criticize the code. I want to know if I'm writing C ...
buzzbuzz20xx's user avatar
9 votes
4 answers
1k views

Below is the code I wrote to implement a singly linked list. To keep things simple, I omitted things like copy constructor. Aside from general feedback, here are some specifics I would like addressed: ...
user1446642's user avatar
4 votes
3 answers
1k views

Issues with generics < E > and < E extends Comparable > in code below. What changes are needed in the code below to prevent DLList.push_front() and DLList.push_back() from accepting ...
rcgldr's user avatar
  • 376
5 votes
2 answers
250 views

Clarification of Intent Recursion here is used on purpose for practice - note that iteration is preferred in this case (I'll be more clear about where my intentions are!) Factory function was also ...
bdng's user avatar
  • 51
3 votes
1 answer
102 views

My previous post: Simple Stack and Deque implementation I have implemented 2 classes for my project similar to stack and deque. This is my second attempt to get advice and evaluation of my code. Maybe ...
vansergh's user avatar
  • 313
1 vote
1 answer
154 views

I implemented a single-linked and double-linked lists (like stack and deque). I would like to receive your feedback on improving the code or maybe some comments. I'm learning C++ for the third month. ...
vansergh's user avatar
  • 313
4 votes
3 answers
723 views

I have seen many list implementations in C in this site; I know its been asked many times. I need some advice regarding: Quality of my code, especially my list library. How to handle errors in main (...
Sai_krishna's user avatar
9 votes
2 answers
1k views

I am trying to learn C# and created this project to improve. I will be using C# professionally so a harsh critique is welcome. ...
Doruk's user avatar
  • 423
2 votes
1 answer
82 views

Link to Original Problem: Advent of Code 2022 Day 13 Question Summary: The task involves sorting and parsing nested lists, with two parts: Determine pairs in the correct order and calculate the sum ...
fish_brain's user avatar
3 votes
4 answers
759 views

I've been programming for 3 months now, and I've just come across Linked List, and I'm not gonna lie, I've been struggling a little. I wrote this code to practice on Linked Lists. The purpose is to ...
fraber's user avatar
  • 189
5 votes
2 answers
423 views

I have tried to implement a code that does the following: store words in an array (unordered) use function order_array() to place repetitions for the same word ...
Arsenio's user avatar
  • 53
5 votes
3 answers
598 views

I have created a templated linked list to take different objects. I was told to put this up for code review as it could use some improvements. To be honest, I am not completely sure when to use the '...
Peazypound1212's user avatar
2 votes
1 answer
326 views

I'm a sophomore in computer science who's working on a linked list class for his DSA class. I believe this code can be improved, but I'm not sure how because everything got really messy really fast. ...
ozan's user avatar
  • 43
4 votes
2 answers
2k views

After watching Stroustrup's presentation on performance comparison between vectors and linked lists (https://youtu.be/YQs6IC-vgmo?si=9r5wXqnwkmN29xqn), I've decided it would be a good problem to get a ...
low-altitude's user avatar
0 votes
1 answer
289 views

I have a small Linked list program which I created for just brushing up the concepts. Following is my Node class ...
Jyothish Bhaskaran's user avatar
3 votes
1 answer
165 views

I used cppreference list to implement this simplified std::list. The CXX_STANDARD is 11. My questions are the usual: Is the ...
Abner's user avatar
  • 39
0 votes
2 answers
547 views

An absolute beginner here who is practising linked list problems in hackerrank. Stumbled upon this question which is categorised as easy. Given a pointer to the head node of the linked list, print ...
brucey's user avatar
  • 19
6 votes
3 answers
576 views

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_hate_F_sharp's user avatar
1 vote
1 answer
91 views

I have revised the implementation I originally posted here. Thank you all who responded; I took your comments to heart. Please let me know if you have any additional feedback. Here are some notes to ...
user129393192's user avatar
5 votes
4 answers
2k views

Here is some code I've written. I am welcoming any critiques, whether it is style/formatting, correctness (I believe it is correct) -- I would appreciate any advice on formatting unit tests, and any ...
user129393192's user avatar
3 votes
1 answer
150 views

This is my first time implementing a doubly-linked list. I would like some feedback on my code. Any comment would be appreciated regarding the quality of the code, bad implementation, memory ...
Toideki's user avatar
  • 31
3 votes
2 answers
563 views

I'm trying to build step by step a C library that will include some of the major Data Structures such as Linked Lists, Stacks, Binary Trees etc., mostly in order to practice my C programming skills ...
BarAmber's user avatar
  • 105
5 votes
3 answers
994 views

I've started to experiment with (void *) in C, in order to work with Dynamic Data Types, that is, to surpass the need to pass specific type of data. I have implemented this doubly linked list in C and ...
BarAmber's user avatar
  • 105
4 votes
2 answers
6k views

I was recently presented with the following problem... You are given a collection of singly-linked lists (SLLs). Return true if any of them share a common node (or “intersect”), or false otherwise. ...
James Law's user avatar
  • 489
1 vote
1 answer
111 views

I wrote a working linked list program in C. What can I improve in my code in your opinion? The first thing I think about is doing unit tests. I want to learn TDD. I'm not sure if it is a good idea to ...
whiteman808's user avatar
3 votes
1 answer
123 views

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, ...
Madagascar's user avatar
  • 10.1k
2 votes
2 answers
226 views

I have written code for this leetcode problem :- Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to ...
Strange Alchemist's user avatar
1 vote
4 answers
969 views

I have implemented my queue based on doubly linked list. The codes is tested and works, however, I am interested in some improvement ideas, thanks Based on some review remarks on my previous ...
V_head's user avatar
  • 575
1 vote
4 answers
866 views

I have implemented my stack based on a doubly linked list. The code is tested and works; however, I am interested in any improvement ideas. ...
V_head's user avatar
  • 575
4 votes
4 answers
1k views

Previous versions of this question First Version Second Version Third Version Fourth Version Changes I built upon the previous singly linked list and implemented a doubly linked one. You are not ...
V_head's user avatar
  • 575
3 votes
2 answers
291 views

Previous versions of this question First Version Second Version Changes I added these operations: Pop_back Pop_front You are not allowed to insert_sll at the ...
V_head's user avatar
  • 575
3 votes
2 answers
418 views

I have implemented my singly linked list in C and I tried to do it with the most efficient code as possible. Is there any place for improvement? This post is the second version. First version of this ...
V_head's user avatar
  • 575
3 votes
1 answer
279 views

I have tried to implement my singly linked list to be optimal in the sense that when inserting I don't have to search for the tail and then chain the new node to it, I just keep track of the tail and ...
V_head's user avatar
  • 575
6 votes
1 answer
516 views

As an exercise I've implemented malloc and free in Python as a first fit free list as described here. This tracks which blocks are free in a doubly linked list that is sorted by the address of the ...
Xander Dunn's user avatar
8 votes
1 answer
747 views

I once tried to make a generic linked list in pure C (no external libraries, only the C standard library) here using C macros. With the same restrictions as in the previous attempt, this time I'm ...
404 Name Not Found's user avatar
4 votes
2 answers
202 views

The tricky thing was keeping copies of list iterators in a tree map and managing both together. I'm not handling invalid input cases (like popping an empty stack) in this code. I am following Google C+...
user267704's user avatar
7 votes
3 answers
552 views

For a recent project of mine I had to create various data structures in pure C with no external libraries (in other words, code I've written by myself), which lacks the templating and OOP capabilities ...
404 Name Not Found's user avatar
1 vote
2 answers
141 views

In this post, I will compare performance of a circular list and a conventional list with head/tail -references: ...
coderodde's user avatar
  • 32.2k
2 votes
1 answer
128 views

I've implemented constructor, push , pop, drop and some macro. I need to know if the drop implementation is correct and is drop is really necessary? Meanwhile I still didn't check about ...
Nithin Gowda's user avatar
3 votes
3 answers
559 views

Edited: incorporated some feedback and added a lot of features I've written a basic Doubly Linked List Class where every insertion into the class should be sorted into ascending order. The project ...
Hofbr's user avatar
  • 371
2 votes
1 answer
277 views

Yesterday, inspired by some great questions here, I decided to give myself some practice with Rust, by solving all the introductory questions over on LeetCode. It was a great learning exercise, and ...
Davislor's user avatar
  • 9,165
1 vote
2 answers
224 views

My professor required we make a LinkedList class with a bool add(in newEntry) method. Two things I'm questioning my choices on ...
Hofbr's user avatar
  • 371
10 votes
7 answers
2k views

I'm learning algorithms and I wrote the single-directional linked list implementation in C. I need a code review of what can I improve in my code and I want to make sure there are no possible memory ...
zxqp's user avatar
  • 101
2 votes
1 answer
142 views

I have a linked list code in C++: ...
narocac's user avatar
  • 65
9 votes
1 answer
1k views

I've been working on an intrusive linked list for the past few days for a personal project and I would like to have some feedback on it. :) Personally, I would have preferred to make ...
Nicholas Sudsgaard's user avatar

1
2 3 4 5
22