Skip to content

Conversation

IshuSinghSE
Copy link

@IshuSinghSE IshuSinghSE commented Sep 7, 2025

This pull request refactors the stack implementation in Program.c from a function-based approach using root pointers to a simpler global-pointer design and introduces a menu-driven interface for user interaction. The changes improve usability and code clarity by consolidating stack operations and providing interactive options.

Refactoring and simplification of stack operations:

  • Replaced the previous function-based stack implementation (using root pointers and helper functions like newNode, isEmpty, and peek) with a global top pointer and direct stack manipulation functions: push, pop, and display.
  • Simplified push and pop functions to operate directly on the global top pointer, removing the need to pass pointers and return values.

User interface improvements:

  • Added a menu-driven loop in main to allow users to interactively push, pop, and display stack elements, with clear prompts and feedback for each operation.
  • Implemented a new display function to show all stack elements, enhancing visibility of stack contents during program execution.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Thank you for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant