Skip to content

Commit 9a70599

Browse files
authored
Update stack_using_linked_lists.c
1 parent ddf671d commit 9a70599

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

data_structures/linked_list/stack_using_linked_lists.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ int main()
3636
}
3737
}
3838

39-
void push(struct node *p) // push function will add a new node at the head of the list, time complexity O(1).
39+
/**
40+
* push function will add a new node at the head of the list, time complexity O(1).
41+
*/
42+
void push(struct node *p)
4043
{
4144
int item;
4245
struct node *temp;
@@ -50,7 +53,11 @@ void push(struct node *p) // push function will add a new node at the head of th
5053

5154
printf("inserted succesfully\n");
5255
}
53-
void pop(struct node *p) // pop function deletes the first node from the head, time complexity O(1).
56+
57+
/**
58+
* pop function deletes the first node from the head, time complexity O(1).
59+
*/
60+
void pop(struct node *p)
5461
{
5562
int item;
5663
struct node *temp;

0 commit comments

Comments
 (0)