-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Update stack_using_linked_lists.c #620
base: master
Are you sure you want to change the base?
Conversation
Added comments and time complexities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes made.
@@ -36,40 +36,47 @@ int main() | |||
} | |||
} | |||
|
|||
void push(struct node *p) | |||
/** | |||
* push function will add a new node at the head of the list, time complexity O(1). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes made.
{ | ||
int item; | ||
struct node *temp; | ||
temp = (struct node *)malloc(sizeof(struct node)); | ||
temp = (struct node *)malloc(sizeof(struct node)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this empty whitespace.
Same in other parts of the code.
temp = (struct node *)malloc(sizeof(struct node)); | |
temp = (struct node *)malloc(sizeof(struct node)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespaces removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good work. 👍 😄
Co-authored-by: David Leal <[email protected]>
Co-authored-by: David Leal <[email protected]>
Co-authored-by: David Leal <[email protected]>
Description of Change
Added comments and time complexities.