What are Stacks and Bubble Sorts

Stacks are a type of list in which all inserts and removals happen at one end

class stack
{
  public:
    stack(void);                // Constructor and Initializer

    bool push(int data);        // Push onto stack
    bool pop(int data);         // Pop from stack
    int  peek(int depth);       // Peek several layers down

  private:
    const int MAX_SIZE;         // Maximum stack size
    int   stack_data[MAX_SIZE]; // Stack Data Array
    int   stack_top;            // Keeps track of Stack Top
};

BUBBLE SORT

// By convention, 'n' is usually the size of the
// array to be sorted.
void bubblesort( int array[], int n )
{
  for ( int i = 0; i < n-1; ++i )
    for ( int j = 1; j < n-i; ++j )
      if ( array[j-1] > array[j] )
        // Note the use here of swap()
        swap( array[j-1], array[j] );
}