Skip to main content

All Questions

Filter by
Sorted by
Tagged with
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
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