update stack and queue.

This commit is contained in:
Yudong Jin
2022-11-30 03:46:53 +08:00
parent 8669e06414
commit acfdc713ba
13 changed files with 321 additions and 124 deletions

View File

@ -69,6 +69,10 @@ int main() {
int top = stack->top();
cout << "栈顶元素 top = " << top << endl;
/* 访问索引 index 处元素 */
int num = stack->get(3);
cout << "栈索引 3 处的元素为 num = " << num << endl;
/* 元素出栈 */
int pop = stack->pop();
cout << "出栈元素 pop = " << pop << ",出栈后 stack = ";