Professional Documents
Culture Documents
Lab Mid Term - Data Structures Using C - 022
Lab Mid Term - Data Structures Using C - 022
/* UTILITY FUNCTIONS */
/* Function to insert a node at the beginging of the Doubly Linked List */
void push(struct Node** head_ref, int new_data)
{
/* allocate node */
struct Node* new_node =
(struct Node*) malloc(sizeof(struct Node));
/* Driver code*/
int main()
{
/* Start with the empty list */
struct Node* head = NULL;
getchar();
}
Output:
Original linked list
10 8 4 2
The reversed Linked List is
2 4 8 10