Skip to main content

All Questions

2 votes
2 answers
135 views

LinkedList Stack Implementation

I'm new to the programming and I want to ask a question about my linkedlist stack implementation if it's correct and if it meets the requirements of the linkedlist stack implementation. If there is ...
E.Etem's user avatar
  • 31
0 votes
2 answers
71 views

Another Stack implementation in Java

I'm trying to write my own stack implementation using LinkedList. It looks like it is doing what it should doing. But how does it look from a design perspective? ...
Paweł Jarosiewicz's user avatar
3 votes
1 answer
759 views

Detecting a cycle in a linked list using Java

I'm solving HackerRank "Linked Lists: Detect a Cycle" challenge. A linked list is said to contain a cycle if any node is visited more than once while traversing the list. Complete the ...
justapilgrim's user avatar
4 votes
3 answers
372 views

Linked list node implementation with maximum code reuse

Currently as an exercise to practicing SOLID principles and basic data structures, I am trying to implement linked list type structures with as much code reuse as possible. Currently, I have: ...
Matthew Wahner's user avatar
4 votes
2 answers
2k views

LinkedList implementation with Iterators in Java

I am a newbie to Java. I will be glad to hear your opinion with regards to this LinkedList implementation. The Iterators are self implemented by my decision: ...
Arigatonic's user avatar
1 vote
3 answers
823 views

Doubly linked list in Java

I did not add generics to my code because I am new to Java. I am on my way in learning data structures and algorithms. I just want to make sure that my code is clean and efficient. ...
Gs niteesh's user avatar
2 votes
1 answer
140 views

Partition a singly linked list using Java - follow-up

This is a follow up to my last question: Partition a singly linked list using Java Based on the feedback I received there, I changed the following about the code: Added a ...
Average's user avatar
  • 841
2 votes
2 answers
1k views

Partition a singly linked list using Java

This is my attempted solution to exercise 2.4 in Cracking the Coding Interview. The problem statement is: Write code to partition a linked list around a value x such that all nodes less than x come ...
Average's user avatar
  • 841
2 votes
1 answer
658 views

Implementation of Queue using Linkedlist in Java

Can someone please review my code? Is it the correct implementation of a queue? If not, please give suggestions on how to implement it using a linked list. ...
nik7's user avatar
  • 23
4 votes
1 answer
75 views

How can I enhance my linkedlist implementation in java?

I recently implemented Linked List on my own. I did not use generics as I am still learning. How can I improve it: ...
Gs niteesh's user avatar
0 votes
1 answer
1k views

Using composition or inheritance to enhance this linked list

Problem Statement: A method called insertEnd() exists, but it runs in linear time, because every time it is called, it walks down the list to find the end. Without changing the meaning of this ...
overexchange's user avatar
  • 3,401
2 votes
1 answer
191 views

Self-made linked list implementing List<E>

I have to make a linked list as a quasi-homework task, about which I have already asked two questions about here and here. Since the whole code is really big (400 lines approx.), I will include only ...
Attila Herbert's user avatar
5 votes
3 answers
7k views

Custom linked list implementing Iterable used as stack

I have created a custom linked list that implements the Iterable interface. I am then using this linked list to implement my custom stack. I have also thrown a ...
Ishan Soni's user avatar
13 votes
2 answers
30k views

Self-made linked list iterator

I recently made a linked list for myself, the code of which was posted here, if anyone would be interested. Now, as the next task, I had to make an Iterator for my ...
Attila Herbert's user avatar
18 votes
5 answers
5k views

Self-made Linked List

I was tasked by my teacher with making a linked list by myself, so I could understand the concept better. Here is the MyLinkedList class: ...
Attila Herbert's user avatar

15 30 50 per page