Skip to content

Commit 12044c8

Browse files
authored
Update stack_using_linked_lists.c
1 parent 7bb6d59 commit 12044c8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

data_structures/linked_list/stack_using_linked_lists.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ int main()
3737
}
3838

3939
/**
40-
* push function will add a new node at the head of the list, time complexity O(1).
41-
* @param p pointer to the top of the stack.
42-
* @returns void.
40+
* push function will add a new node at the head of the list, time complexity O(1)
41+
* @param p pointer to the top of the stack
42+
* @returns void
4343
*/
4444
void push(struct node *p)
4545
{
4646
int item;
4747
struct node *temp;
48-
temp = (struct node *)malloc(sizeof(struct node));
48+
temp = (struct node *)malloc(sizeof(struct node));
4949
printf("enter element to be inserted\n");
5050
scanf("%d", &item);
5151
temp->info = item;
@@ -57,16 +57,16 @@ void push(struct node *p)
5757
}
5858

5959
/**
60-
* pop function deletes the first node from the head, time complexity O(1).
61-
* @param p pointer to the top of the stack.
62-
* @returns void.
60+
* pop function deletes the first node from the head, time complexity O(1)
61+
* @param p pointer to the top of the stack
62+
* @returns void
6363
*/
64-
void pop(struct node *p)
64+
void pop(struct node *p)
6565
{
6666
int item;
6767
struct node *temp;
6868

69-
if (top == NULL)
69+
if (top == NULL)
7070
printf("stack is empty\n");
7171
else
7272
{

0 commit comments

Comments
 (0)