Search:

Type: Posts; User: EDale

Search: Search took 0.10 seconds.

  1. Replies
    13
    Views
    1,589

    Re: Creating methods in a singly linked list?

    Perhaps... depending on how big the deck of cards is. So to write this method I would start off with a loop that compares the data to the argument... and then what?
  2. Replies
    13
    Views
    1,589

    Re: Creating methods in a singly linked list?

    So then if you go through the deck of cards and look at each card one by one, you wouldn't know which is the last one until you go through the whole deck. Would you then have to go through the deck...
  3. Replies
    13
    Views
    1,589

    Re: Creating methods in a singly linked list?

    Great, it worked, thank you.

    Well to find the suit of that last queen... every deck of cards should only have 4 queens, so you just look for the 4th queen and return the suit. So does this mean...
  4. Replies
    13
    Views
    1,589

    Re: Creating methods in a singly linked list?

    Right, it shows the error at the "i" in the line if(this.equals(getNode(i))). I'm trying to compare the argument to the node at index i. Could you show me how I can do this properly to correct the...
  5. Replies
    13
    Views
    1,589

    Re: Creating methods in a singly linked list?

    So for the error, it tells me "i cannot be resolved to a variable."

    Perhaps you didn't understand my question. For the removeLastOccurence method, the program needs to skip over the first and...
  6. Replies
    13
    Views
    1,589

    Re: Creating methods in a singly linked list?

    Okay well I did a little research and I think I've created the first two methods roughly. So lets start with the first two. Here is my code:


    public E remove(int index) {
    Node<E> temp =...
  7. Replies
    13
    Views
    1,589

    Creating methods in a singly linked list?

    I want to create 4 methods for my singly linked list class: public boolean removeFirstOccurence(Object o), public boolean removeLastOccurence(Object o), public int indexOf(Object o), public int...
Results 1 to 7 of 7