Search:

Type: Posts; User: zkidkid

Search: Search took 0.10 seconds.

  1. Replies
    17
    Views
    1,740

    Re: Deque array base assistant

    Hi @gto11520,
    Let image that you have a fixed array for 5 items. [][][][][][]
    You put 1 front(value 1) & 1 rear (value2) with your code then you will have:


    public void insertFront(Item item)...
  2. Replies
    17
    Views
    1,740

    Re: Deque array base assistant

    NullPointer at this code: queArray[i].toString()
    your queArray[i] == null.

    Please put your whole code.
    It's easier than you think.
  3. Replies
    17
    Views
    1,740

    Re: Deque array base assistant

    Please put your code so that we could help.
    at the first step, you could only implement queue(E) and dequeue() method to get understand clearly first and then implement others.
    it would be easier &...
  4. Replies
    17
    Views
    1,740

    Re: Deque array base assistant

    Yes if you "flow control" mean to make sure "front" always lower than "rear" ( front <= rear)

    For better implement, I also suggest you take a look of LinkedList.
  5. Replies
    17
    Views
    1,740

    Re: Deque array base assistant

    At the first time:
    When we insert front, your front = max_size -1
    Then we insert rear, your rear = 0
    Then look at your toString():
    for(i = front; i <= rear)
    -> front > rear -> print nothing.
    ...
Results 1 to 5 of 5