Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack.c: Add stack using array in C #315

Merged
merged 2 commits into from
Oct 14, 2018
Merged

Conversation

jadia
Copy link

@jadia jadia commented Oct 6, 2018

The code is modular and simple to understand for a newbie.

Stack is an ordered list of similar data type. Stack is a LIFO(Last in First out) structure or we can say FILO(First in Last out). push() function is used to insert new elements into the Stack and pop() function is used to remove an element from the stack.

Fixes #40

By submitting this pull request I confirm I've read and complied with the
below declarations.

  • I have read the Contribution guidelines and I am confident that my PR reflects them.
  • I have followed the commit guidelines for this project.
  • My code follows the standard code structure.
  • This pull request has a descriptive title. For example, {Tag}: Add {Algorithm/DS name} [{Language}], not Update README.md or Added new code.
  • This pull request will be closed if I fail to update it even once in a continuous time span of 7 days.
  • This pull request shall only be reviewed and merged once all the checks passes. No maintainer or supporter shall be obliged to review it before this condition is met.
  • I have mentioned the issue number correctly (with hyperlink) in this pull request description.

After you submit your pull request, DO NOT click the 'Update Branch' button.

if(*top == -1) {
printf("\n Stack empty!\n");
exit(1);
}
Copy link
Member

Choose a reason for hiding this comment

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

Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3]

Origin: CPPLintBear, Section: all.cpplint.

Copy link
Author

Choose a reason for hiding this comment

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

I tried fixing this in f487f89 commit.

@jadia
Copy link
Author

jadia commented Oct 7, 2018

I tried my best to follow the strict indentation guidelines. But, I don't know if I'll ever be able to make though a single PR. I hope you'll fix the indentation problem.

Thank you.

stack/C/stackUsingArray.c Outdated Show resolved Hide resolved
stack/C/stackUsingArray.c Outdated Show resolved Hide resolved
stack/C/stackUsingArray.c Outdated Show resolved Hide resolved
stack/C/stackUsingArray.c Outdated Show resolved Hide resolved
stack/C/stackUsingArray.c Outdated Show resolved Hide resolved
@sangamcse
Copy link
Member

Cool. Now you need to squash your commits into one. You can take help from https://github.com/NITSkmOS/Algorithms/blob/master/GIT_BASICS.md

@jadia jadia force-pushed the stack_using_c branch 2 times, most recently from 461f386 to 2c61773 Compare October 14, 2018 09:33
jadia added a commit to jadia/Algorithms that referenced this pull request Oct 14, 2018
Added stack data structure code in C.

Closes NITSkmOS#315
@sangamcse sangamcse changed the title Stack using c stack.c: Add stack using array in C Oct 14, 2018
jadia added a commit to jadia/Algorithms that referenced this pull request Oct 14, 2018
Added stack data structure code in C.

Closes NITSkmOS#315
jadia added a commit to jadia/Algorithms that referenced this pull request Oct 14, 2018
Add stack data structure code in C.

Closes NITSkmOS#315
Add stack data structure code in C.

Closes NITSkmOS#315
@sangamcse sangamcse merged commit a72ffcd into NITSkmOS:master Oct 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataStructure] Stack [C]
2 participants