Answer:
True
Step-by-step explanation:
Algorithm for push function
The method of placing data on a stack is called a push operation.
It involves these steps −
- Check that the stack is complete.
- If the stack is complete, it will cause an error .
- Increases top to point next empty room if the stack is not complete.
- Adds the data component to the place of the stack where top is pointing.
Algorithm for Insertfirst function
- Create a new Link with provided data.
- Point New Link to old First Link.
- Point First Link to this New Link.
As we can see that in both algorithms ,we are inserting data to a new nodes and incrementing/pointing to a new node for inserting data.Both algorithms uses the same approach.