Pop back function

why we r making empty function instead we can directly use if(cs!=0){
cs–;
}

Yes, You can do that. but in the video we are trying to replicate the same nature of vector as in C++ STL.
And also sometimes in the code you might want to use empty() func. for example if you want to loop till the vector v is not empty, you can write while(!v.empty()) . So having a empty() is helpful.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.