A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/d7/d43/stack__using__queue_8cpp_source.html below:

TheAlgorithms/C++: data_structures/stack_using_queue.cpp Source File

50 while

(!

main_q

.empty()) {

89

assert(s.

size

() == 3);

91

assert(s.

top

() == 3);

94

assert(s.

top

() == 2);

97

assert(s.

top

() == 1);

100

assert(s.

top

() == 5);

103

assert(s.

top

() == 1);

105

assert(s.

size

() == 1);

static void test()

Self-test implementations.

int main()

Main function.

Functions for the Stack Using Queue implementation.

Stack Class implementation for basic methods of Stack Data Structure.

std::queue< int64_t > auxiliary_q

void pop()

Removes the topmost element from the stack.

int size()

Utility function to return the current size of the stack.

std::queue< int64_t > main_q

stores the current state of the stack

void push(int val)

Inserts an element to the top of the stack.

uint32_t current_size

stores the current size of the stack


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4