Linked List – remove duplicates algorithm in C#/Java

I am studying Data Structures and Algorithms in C#/Java. After encountering a solution to the problem of Linked List duplicate removal, I have been struggling to understand it. The solution is the one …

Realization of “get method” by splitting Linkedlist

I’m just studying Linkedlist topic and trying to implement different functions like remove, add and get. Here is my implementation of get method to get the value of the element from double linked list….

Why does the class fields update their data after the method works

Help me please. Let’s say I have a Link class for linked lists. And there is the SortedList class where there are methods for working with data created by the first class. public class Link { public …

implementation of LinkedList without last node

I have been asked to re-implement a linked list without the use of a tail. So I have to change its methods so it can work without using a tail node. The removeLast method confused me: here is what I …

Leetcode #2, getting detected a cycle error

I was trying to solve leetcode#2, You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit….

Is it possible to use 2 Data Type in an Custom ADT(Sorted Linked List)?

I am trying to do a Leaderboard for a game by using a Sorted Linked List. I was able to do so by sorting the point in descending order which mean higher point to lower point. Moreover, I will also …

LinkedList inside a LinkedList iteration in java

Im trying to iterate a Linked List inside of a linked list but I’m not sure how to proceed with it. I’m used to using a passed parameter for what will be iterated but when I’m iterating a linked list …

Creating a sorted link list out of a normal linked list

As I’ve just started programming a few months back a lot of new information is coming and I’m having trouble catching up.So here I have created what I thought was a sorted linked list.Turns out it is …

Array of LinkedList adding new nodes

I’ve created an array (using the second answer from this method) by: public static LinkedList[] map; … // later …. map = (LinkedList[]) new LinkedList[count]; …