Skip to content

Update stack_using_linked_lists.c #620

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Update stack_using_linked_lists.c
  • Loading branch information
Shwetik authored Sep 30, 2020
commit 9a7059935b308a63a43e7774e9a615a95e2c370e
11 changes: 9 additions & 2 deletions data_structures/linked_list/stack_using_linked_lists.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ int main()
}
}

void push(struct node *p) // push function will add a new node at the head of the list, time complexity O(1).
/**
* push function will add a new node at the head of the list, time complexity O(1).
Copy link
Member

Choose a reason for hiding this comment

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

Missing parameter documentation.
Same in other parts of the code.

*/
void push(struct node *p)
{
int item;
struct node *temp;
Expand All @@ -50,7 +53,11 @@ void push(struct node *p) // push function will add a new node at the head of th

printf("inserted succesfully\n");
}
void pop(struct node *p) // pop function deletes the first node from the head, time complexity O(1).

/**
* pop function deletes the first node from the head, time complexity O(1).
*/
void pop(struct node *p)
{
int item;
struct node *temp;
Expand Down