educative.io

Operations and implementations

Are the functions and operations mentioned in examples how the data structures are implemented or else do we need to define these operations separately which has been done in the background?

Hi @Pranav2 !!
The functions and operations mentioned in the examples (such as Push, Pop, Top, Size, and IsEmpty) are part of the abstract data type (ADT) definition for a stack. These are the common operations that define how a stack should behave. In order to use these operations, you would need to define the underlying implementation of the stack, including how the data is stored and manipulated to achieve the desired behavior, you can’t directly use the operations without providing the actual implementation behind them.
I hope it helps. Happy Learning :blush: