Search:

Type: Posts; User: jkalm

Search: Search took 0.29 seconds.

  1. Replies
    6
    Views
    3,499

    Re: Priority Queue using comparable

    I'm having trouble trying to move all elements right in this queue. For example, I need to place something in between others because it's priority says it's in there, so how would i make space for it...
  2. Replies
    6
    Views
    3,499

    Re: Priority Queue using comparable

    Ok, ill give it try.. Am i along the right track with what i have though??
  3. Replies
    6
    Views
    3,499

    Re: Priority Queue using comparable

    I think we have to make it generic and able to work with any kind of object?? Ye its a class exercise.. im just wondering if my enqueue method is on the right track.. "Joining the queue...
  4. Replies
    6
    Views
    3,499

    Priority Queue using comparable

    Hey,

    Im trying to make a Prioity Queue that uses the queue interface and comparable.. The objects will be placed in depending on their priority.. i'm having a bit of trouble with it, probaly...
  5. Thread: ADT list help

    by jkalm
    Replies
    15
    Views
    2,013

    Re: ADT list help

    The contains method is working, I put in a new contains in the test and that one works ok. It's still the last one that fails. We're allowed assume there will always be enough room.. I'm not...
  6. Thread: ADT list help

    by jkalm
    Replies
    15
    Views
    2,013

    Re: ADT list help

    Having some trouble with the addGroup method. Really can't see where it's failing.

    This is the code

    public boolean addGroup(Vector<Object> objects, int start)
    {

    for(int i = 0; i <...
  7. Thread: ADT list help

    by jkalm
    Replies
    15
    Views
    2,013

    Re: ADT list help

    I've gotten this so far. I'm not sure if it will just return true no matter what happens though. Also, I'm getting warnings saying Vector is a raw type.


    public boolean addGroup(Vector...
  8. Thread: ADT list help

    by jkalm
    Replies
    15
    Views
    2,013

    Re: ADT list help

    thanks, I'll give it a go and get back to you.
  9. Thread: ADT list help

    by jkalm
    Replies
    15
    Views
    2,013

    Re: ADT list help

    Hey thanks for replying again. Do we have to resize the array even though it says "You may assume that the list/array will always be big enough to take the additional objects."? or is it just...
  10. Thread: ADT list help

    by jkalm
    Replies
    15
    Views
    2,013

    Re: ADT list help

    Hey I now have to do: boolean addGroup(Vector objects, int start). Really don't know where to start, never done vectors before.
    The description is : This method adds the elements in the...
  11. Thread: ADT list help

    by jkalm
    Replies
    15
    Views
    2,013

    Re: ADT list help

    Hey thanks a lot. Really helped me out. I added this to the end and all seems ok. I made tests for it and there doesn't seem to be any problems, thanks again.


    //Checks if either indexes...
  12. Thread: ADT list help

    by jkalm
    Replies
    15
    Views
    2,013

    Re: ADT list help

    Hey, thanks for replying. I've posted what i have so far. I know the "isSuccessful" isn't changing or anything, just wondering if i'm on the right track. thanks again




    public...
  13. Thread: ADT list help

    by jkalm
    Replies
    15
    Views
    2,013

    ADT list help

    Hey, i'm having trouble understanding what to do for the following. I have to do a swap method:
    public boolean swap(Object one, Object two)
    I'm doing it in Alist, using an array. I'll have...
Results 1 to 13 of 13