Hello guys, I'm dealing with stacks and the general concept if pretty straightforward (FILO/LIFO). I'm using a stack to reformat an infix equation to postfix and prefix notation. I've seen several...
Type: Posts; User: javaStooge
Hello guys, I'm dealing with stacks and the general concept if pretty straightforward (FILO/LIFO). I'm using a stack to reformat an infix equation to postfix and prefix notation. I've seen several...
I realized my Node type does not need a generic type (located in the Node class), but then I get the error above when I remove it. Is there a way to avoid this? I've also tried to define the type,...
*Updated* I forgot to add the exception class. :(|)
I've outlined the linkedlist concept on pen and paper, and feel I have a fairly good grasp of it. (I'll be sure to use the "process" you...
main
public class MainClass {
public static void main(String[] args) throws PointerOutOfBoundsException {
// StringX star = new StringX("Betelgeuse");...
Hey Norm, walked away for a bit.
The error after compiling.
Now, I made a quick change and I got the newMember to print..by some miracle. It is still throwing the error though. Line 128 is...
I've checked my code against several different source and I don't see any serious difference. there is nothing unique about my code and yet it still returns a nullpointer error. Can you guys please...
temp.next will have the address of the current head node...but it will contain the newest member in the list. Head should always remain the first link in the list -- that is why I used newNode =...
Ok, lets start with the addToFront method:
1. I understand the if statement...its saying if a node is empty, add the new node with its member, assign it as head, and link it with old head.
2. If...
Would you mind explaining to me exactly what is going on here. What is newNode.next = tail accomplishing? In my class NodeList, next is defined as NodeList<T>...which is the format I've adopted from...
Thank you guys. I thought so, but I just wanted to make sure -- I saw an example where they created separate classes for the two but they weren't using generics.
public class NodeList<T> {...
Is it possible create a single Node class (Node<T>) that can account for a list for integers and a list for strings? Or is it better to create a separate class to do this?
I'm not trying to compile it yet...I'm not ready for that. I have my other classes...I just provided the class with the issue. I thought the issue was contained within this class alone.
public class MySinglyLinkedListD<T> implements SinglyLinkedList<T> {
protected ListNode<T> head, tail, current;
String name;
int size = 0;
//Simple constructor
...
That is all the error message contained.
next() is defined within the same class where I am trying to use it---that's what I don't understand. I'm having the same issue when I try to use my...
Posted here to make sure it notified you.
cannot find symbol
symbol: method next()
location: variable newNode of type ListNode<T>
where T is a type-variable:
T extends Object declared in class...
The hasNext() method supposed to return whether the next element or node is empty and return that node or return the node value.
I'm having a little trouble with the next() method. I want to test...
For this program I am dealing with the linkedlist interface. I am designing a method "insert" that will add a new member to a specified location provided by the user (public insert(T newMem, int...
Fantastic. Thank you Norm.
I created the splits, but when I run the program I can't get the gui to load. There are no errors in the code, but GUI won't load to test. I instantiated a person...
I have a JPanel called addPanel, which is where new contact can be added to list. Given that each contact can have multiple emails, phone numbers, and addresses...how can I allow the user to enter...
Yes. We are not supposed to use either imports. So, should "ArrayListX" be renamed, for example, AddressBook?
Clearly I don't know what I'm doing because nobody understands what I'm trying to explain. The example give by our professor had a List interface:
public interface List <T>
{
//append
public...
It can, as far as I can tell...it's a generic type. I was going to give it the type Contact (ArrayListC<Contact> contacts = new ArrayListC<>(); ). I've never used arraylist before and I'm trying to...
"You are to design a Java application using the list data structure to manage your contact information. Each contact may have the following data:
name
addresses
e-mails
phones
group
Each...
Originally I had the class named differently until I spoke with someone that said I should name it ArrayList.
Gladly. I'd like to add that I am a little confused as to how I should code the program so that each contain can have 'x' number of emails, addresses, and phone numbers. Not sure I've coded for this...