Results 1 to 2 of 2

Thread: CIrcular Arrays

  1. #1
    Bgreen7887 is offline Senior Member
    Join Date
    Oct 2010
    Location
    Newark,nj
    Posts
    111
    Rep Power
    0

    Default CIrcular Arrays

    Suppose a classed name undostack implements a stack that allows unlimited pushes by forgetting old data as described above by using a circular arry.the data is stored inj a private array memeber declared as Object data[]. Private data meber B is the index of the bottom element in the stack. Member T is the top of the stack.Member C is the count of how many objects are in the stack.......

    i wrote the constructor as
    Java Code:
    public UndoStack(initialSize){ //constructor
                data = new Object[initialSize];
                t=0;
                b=data.length-1;
                c=0
    I WANTED TO ASK CAN ANYONE GUIDE ME TO HOW I WRITE A BASIC PUSH AND POP METHOD??

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

Similar Threads

  1. Trouble with circular singly linked queue
    By somewierdguy in forum New To Java
    Replies: 2
    Last Post: 12-06-2010, 01:48 AM
  2. Need help with circular arrays
    By bap2 in forum New To Java
    Replies: 6
    Last Post: 11-04-2010, 08:39 PM
  3. Problem prioritizing a circular queue
    By Metastar in forum New To Java
    Replies: 1
    Last Post: 10-03-2010, 11:40 PM
  4. Circular Double Linked List
    By theonly in forum Advanced Java
    Replies: 3
    Last Post: 12-06-2009, 05:10 PM
  5. Trouble Developing Singly Linked Circular List
    By VinceGuad in forum New To Java
    Replies: 14
    Last Post: 02-25-2009, 04:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •