current position:Home>What does the class name in the class mean? It's not a variable or a member function

What does the class name in the class mean? It's not a variable or a member function

2022-02-02 11:43:43 CSDN Q & A

What you see in the question of Li Kou , Just started to brush the topic ,155 topic , I don't quite understand ,public The next one Minstack What is it? ,
class MinStack {    stack<int> x_stack;    stack<int> min_stack;public:    MinStack()     {         min_stack.push(INT_MAX);    }        void push(int val) {        x_stack.push(val);        min_stack.push(min(val,min_stack.top()));    }        void pop() {                min_stack.pop();                x_stack.pop();    }        int top() {        return x_stack.top();    }        int getMin() {        return min_stack.top();    }};

img

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202021143411554.html

Random recommended