SDSL: Succinct Data Structure Library
A C++ template library for succinct data structures
 All Classes Namespaces Files Functions Variables Typedefs Friends
Public Types | Public Member Functions
sdsl::sorted_int_stack Class Reference

A stack class which can contain integers from $0$ to $n-1$ in sorted order. More...

#include <sorted_int_stack.hpp>

List of all members.

Public Types

typedef int_vector< 64 >::size_type size_type

Public Member Functions

 sorted_int_stack (size_type n)
 sorted_int_stack (const sorted_int_stack &sis)
bool empty () const
const size_type top () const
void pop ()
void push (size_type x)
size_type size () const
size_type serialize (std::ostream &out) const
void load (std::istream &in)
sorted_int_stackoperator= (const sorted_int_stack &sis)
 Assign Operator.
bool operator== (const sorted_int_stack &sis) const
 Equality Operator.
bool operator!= (const sorted_int_stack &sis) const
 Unequality Operator.

Detailed Description

A stack class which can contain integers from $0$ to $n-1$ in sorted order.

Space complexity
$n$ bits

Member Function Documentation

bool sdsl::sorted_int_stack::empty ( ) const [inline]

Returns if the stack is empty.

bool sdsl::sorted_int_stack::operator!= ( const sorted_int_stack sis) const [inline]

Unequality Operator.

Two sorted_int_stacks are not equal if any member variable are not equal.

Required for the Equality Comparable Concept of the STL.

See also:
operator==
sorted_int_stack & sdsl::sorted_int_stack::operator= ( const sorted_int_stack sis) [inline]

Assign Operator.

Required for the Assignable Concept of the STL.

bool sdsl::sorted_int_stack::operator== ( const sorted_int_stack sis) const [inline]

Equality Operator.

Two sorted_int_stacks are equal if all member variables are equal.

Required for the Equality Comparable Concept of the STL.

See also:
operator!=
void sdsl::sorted_int_stack::pop ( ) [inline]

Pop the topmost element of the stack.

void sdsl::sorted_int_stack::push ( size_type  x) [inline]

Push value x on the stack.

x Value which should be pushed onto the stack.
Precondition:
top() < x
size_type sdsl::sorted_int_stack::size ( ) const [inline]

Returns the number of element is the stack.

const sorted_int_stack::size_type sdsl::sorted_int_stack::top ( ) const [inline]

Returns the topmost element of the stack.

Precondition:
empty()==false

The documentation for this class was generated from the following file: