Professional Documents
Culture Documents
h>
#include <stdlib.h>
yarp
dasdsadasd
// Data Structure to store a linked list node
struct Node
{
int data;
struct Node* next;
};
printf("null");
}
// Helper function to insert new Node in the beginning of the linked list
void push(struct Node** head, int data)
{
// Allocate the new Node in the heap and set its data
struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->data = data;
// Set the .next pointer of the new Node to point to the current
// first node of the list.
newNode->next = *head;
// Function that takes a linked list and returns a complete copy of that
// list using dummy node using push() function
struct Node* CopyList(struct Node* head)
{
struct Node* current = head; // used to iterate over original list
struct Node* newList = NULL; // head of the new list
struct Node* tail = NULL; // point to last node in new list
return newList;
}
// main method
int main(void)
{
// input keys
int keys[] = {1, 2, 3, 4};
int n = sizeof(keys)/sizeof(keys[0]);
return 0;
}