+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Apr 2009
    Posts
    15

    Stacks and Vectors in C++

     
    I am currently working on a project and need help with one part. We are not allowed to use the built in library for the stack, but instead must create one of our own. We haven't seen any examples of this, and were just told that we could use either a linked list or a vector, and we chose vector. Any help?

  2. #2
    Caveat Emptor Rootstonian's Avatar
    Join Date
    Mar 2005
    Location
    Out of my mind
    Posts
    3,348
    Depends on the data too. A simple array would work if the data isn't too complicated (one or two dimensional array).

    More complicated data would work in a linked-list for sure.

    Just remember the basic rule of a stack (and you'll have to implement this in your code): Stacks are LIFO (Last In First Out) and this is accomplished with PUSH and POP operations.
    You'll need the push and pop functions along with a pointer to the current location within the stack.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to do more advanced vectors.
    By butch81385 in forum Graphic Design and Digital Photography
    Replies: 5
    Last Post: November 19th, 2005, 06:05 PM
  2. Vectors
    By italiamodena575 in forum Graphic Design and Digital Photography
    Replies: 3
    Last Post: September 13th, 2005, 02:18 AM
  3. Vectors in PS??
    By gentry_joey in forum Graphic Design and Digital Photography
    Replies: 2
    Last Post: July 22nd, 2005, 11:36 PM
  4. Photoshop Vectors
    By gentry_joey in forum Graphic Design and Digital Photography
    Replies: 11
    Last Post: August 27th, 2003, 08:18 PM
  5. Vectors are cool
    By Pshawn5 in forum IMO Community
    Replies: 3
    Last Post: January 10th, 2002, 03:20 PM

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Recommended Sites: ResellerRatings Store Reviews