4
votes
Accepted
Linked list implementation in cpp
Overview
This is a singly linked list. Which is fine. But it is relatively trivial to implement a doubly linked list (next/prev link in each node). Also by using a doubly linked list and a sentinel (...
2
votes
Basic Stack Operations using Linked List in C
isEmpty is anti-idiomatic:
if (top == NULL)
{
return 1;
}
else
{
return 0;
}
is a very long way to say
<...
1
vote
Accepted
Basic Stack Operations using Linked List in C
push() has undefined behaviour any time its malloc() returns a null pointer.
isFull() leaks ...
1
vote
Accepted
UpdateCustomer - implementation in C++
First thing I'd say is that it will help document your code if you make function arguments const references when you aren't changing them. It might also help performance, but thats normally less ...
1
vote
Accepted
std::list implementation learning exercise
There’s no point in a design review, because this class is simply a remake of std::list, so I’ll just dive right into the code review.
You don’t specify which ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
linked-list × 1024c++ × 310
java × 252
c × 238
beginner × 108
python × 87
algorithm × 85
reinventing-the-wheel × 65
c++11 × 62
performance × 57
stack × 57
pointers × 54
c# × 50
programming-challenge × 48
interview-questions × 43
memory-management × 39
object-oriented × 35
python-3.x × 34
queue × 29
circular-list × 29
javascript × 28
mergesort × 25
hash-map × 24
unit-testing × 23
iterator × 23