All Questions
13 questions
1
vote
2
answers
116
views
Circular list vs. doubly-linked list: which is faster?
In this post, I will compare performance of a circular list and a conventional list with head/tail -references:
...
0
votes
2
answers
625
views
Josephus Problem with cyclic iterator
Given the Josephus Problem.
Josephus Problem
N people (numbered 1 to N) are standing in a circle. Person 1 kills Person 2 with a sword and gives it to Person 3. Person 3 kills Person 4 and ...
1
vote
1
answer
2k
views
Deleting the head node of a circular linked list
Today I tackled this coding challenge:
Given a circular linked list, implement a method to delete its head node. Return the list's new head node.
I would appreciate any feedback.
...
4
votes
3
answers
10k
views
Circular Singly Linked List using Java
Please review my implementation of a Circular Singly Linked List.
...
2
votes
3
answers
184
views
ADT Stack with a doubly circular linked list
I have managed to implement an ADTStack with a circular doubly linked list. I would like to know whether there are things I could have done better or, I should ...
2
votes
1
answer
6k
views
Form a loop with previous and next
I have a class Edge which looks something like this:
class Edge {
Edge previous;
Edge Next;
}
I have edges in an <...
1
vote
1
answer
6k
views
Doubly circular linked list implementation with successive update in O(1)
For the queries mentioned in link in 3 parts, the first two parts have been addressed, as mentioned below:
Part I (6 points)
list/DList.java contains a skeleton of a doubly-linked list class. Fill ...
2
votes
3
answers
24k
views
Josephus Problem in Java
Problem
The Josephus Problem is a famous mathematical puzzle that goes back to
ancient times. There are many stories to go with the puzzle. One is
that Josephus was one of a group of Jews who ...
2
votes
2
answers
320
views
Is this circular linked list better than the fast & slow pointer method?
I have a faster way to find if a list is circular linked list, in contrast to the solution that Cracking the Coding Interview has offered:
In the below algorithm, ...
11
votes
3
answers
9k
views
Doubly-Linked Circular Linked List
I'm a C++ programmer learning Java in preparation for an OOP class this fall. That being said, Java is fairly new to me so I'd love to hear feedback on how to improve this code.
A few notes:
Code ...
7
votes
2
answers
2k
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:
...
5
votes
2
answers
614
views
Circular linked list of integers
I'm looking for a review paying special attention as to whether the code can be optimized in the form of number of variables used, especially for the delete() ...
3
votes
1
answer
10k
views
Insert in circular linked list
Please review my code.
...