Amit Sahrawat

Finding a circular loop in a linked list

August 29th, 2009  |  by  |  published in Amit Sahrawat, Data Structures

There are several ways to find out if a loop is present in the linked list or not. Let’s look at the two ways: 1) If we can modify the linked list structure, then insert a Boolen (bool) flag called visited in the structure. Start traversing the linked list, on every node mark the flag visit [...]

Program to find the middle of a linked list

August 29th, 2009  |  by  |  published in Amit Sahrawat, Data Structures, Linux Sample Programs

/* Structure for a linked list*/ struct list{     int num;     struct list* next; /* pointer to next node in list*/ }; /* Function to find the middle node for the linked list, given the starting node pointer*/ struct list* middle(struct list* head) {

Program to remove duplicates from a linked list

August 29th, 2009  |  by  |  published in Amit Sahrawat, Data Structures, Linux Sample Programs

/* Structure for a linked list*/ struct list{     int num;     struct list* next; /* pointer to next node in list*/ }; #define FREE(x) free(x);x=NULL; /* Function to remove duplicates from a linked list, given the head pointer for the list*/ void removeDuplicates(struct list** head) {

Program to split a linked list from a given position

August 29th, 2009  |  by  |  published in Amit Sahrawat, Data Structures, Linux Sample Programs

/* Structure for a linked list*/ struct list{     int num;     struct list* next; /* pointer to next node in list*/ }; /* Function to split a linked list into two parts, given the position from which to start splitting*/ void split(struct list* head, struct list** dest, int position) {

Program to delete a node from a linked list

August 29th, 2009  |  by  |  published in Amit Sahrawat, Data Structures, Linux Sample Programs

/* Structure for a linked list*/ struct list{     int num;     struct list* next; /* pointer to next node in list*/ }; #define FREE(x) free(x);x=NULL; /* Function to delete a node from a linked list, given the value for the node*/ int delete(struct list** head, int value) {

Program to find length of linked list using Recursion

August 29th, 2009  |  by  |  published in Amit Sahrawat, Data Structures, Linux Sample Programs

/* Structure for a linked list*/ struct list{     int num;     struct list* next; /* pointer to next node in list*/ }; /* Function to find the length of linked list using recursion, given the starting node pointer*/ int length(struct list* node) {

Program to print linked list in reverse order using Recursion

August 29th, 2009  |  by  |  published in Amit Sahrawat, Data Structures, Linux Sample Programs

/* Structure for a linked list*/ struct list{     int num;     struct list* next; /* pointer to next node in list*/ }; /* Function to print data in reverse order for a linked list, given the starting node pointer*/ void reverseprint(struct list* node) {

Program to traverse the linked list

August 29th, 2009  |  by  |  published in Amit Sahrawat, Data Structures, Linux Sample Programs

/* Structure for a linked list*/ struct list{     int num;     struct list* next; /* pointer to next node in list*/ }; /* Function to traverse the linked list given the starting node pointer */ void traverse(struct list* node) {

Program to insert a node in the linked list

August 29th, 2009  |  by  |  published in Amit Sahrawat, Data Structures, Linux Sample Programs

/* Structure for a linked list*/ struct list{     int num;     struct list* next; /* pointer to next node in list*/ }; /* Function to insert node into a linked list, given the head pointer and the value to be inserted */ void insert(struct list **head,int value) {

Track your LIC policies online

August 23rd, 2009  |  by  |  published in Amit Sahrawat, Investment, TIPS

Track your LIC policies online

LIC India allows you keeping track of your LIC policies online with them. You need to register at http://www.licindia.com and enroll the policies you have. Once you register with licindia, a reminder would be sent to you whenever your premium date is near, and the most important part is it allows you keeping account of [...]

Subscribe

Get articles in your inbox.

Enter your email address:

Join Us

Twitter Chatter


Special Recent Posts

Withdraw Cash from ATM without Card

Withdraw Cash from ATM without Card

September 17th, 2011

Now, there is no need to carry Automated Teller Machine (ATM) card with withdraw cash. Cash-On-Mobi[...]

Health Care For Diabetes

Health Care For Diabetes

September 3rd, 2011

Symptoms to watch out for: If you feel anxious, tired, confused, unusually hungry, or a fast heart b[...]

How To Take Proper Care of Knees

How To Take Proper Care of Knees

August 31st, 2011

Recognize the problem: Firstly, recognize whether it is just a common ache or something more serious[...]

Recommendations

Archives

Categories