Skip to content
Advertisement

Tag: linked-list

LinkedList remove at index java

I’ve made a remove method from scratch that removes a Node from a linked list at a specified index. It’s not removing the correct Node. I’ve tried to step through with the debugger in eclipse but couldn’t catch the problem. Each Node contains a token. I have included the Token class, Node class. I have written my methods in the

Java, comparing a Linked List to an Array

Working on a Java program that will read in two different passages, convert both strings to arrays of strings for each word, and then String One to a linked list, which will promptly be sorted into alphabetical order. After the list has been sorted, I get confused. I have a for loop written to get the length of array2 to

Removing values from a custom LinkedList class

This custom class mimics the functionality of Java’s LinkedList Class except it only takes integers and obviously lacks most of the functionality. For this one method, removeAll(), I am to go through each node for the list and remove all nodes with that value. My problem is that when the first node in the list contains the value to be

How do you remove the first Node in a Linked List?

Sup guys so I’m going over a few of my methods in my Linked List class and I’m getting a logical error when removing a node from a linked list. I was working on my removeFirst() method when I then encountered a error in my removeLast() method as well. The problem is that both remove the last item in the

How to remove certain items from a Stack [closed]

It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago. I have a homework problem in which I need to remove all the

Advertisement