Archive for
August, 2009
August 30th, 2009 | by
Amit Sahrawat | published in
Reviews
                                                                  Before writing this, I must mention that before using this phone I was not very keen on buying Motorola Mobile phones, but this one changed my outlook towards Motorola mobiles. This one is my first Motorola mobile. If ever I had to recommend anyone a Music Phone this would be right at the top. […]
August 29th, 2009 | by
Amit Sahrawat | 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 […]
August 29th, 2009 | by
Amit Sahrawat | 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) {
August 29th, 2009 | by
Amit Sahrawat | 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) {
August 29th, 2009 | by
Amit Sahrawat | 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) {
August 29th, 2009 | by
Amit Sahrawat | 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) {
August 29th, 2009 | by
Amit Sahrawat | 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) {
August 29th, 2009 | by
Amit Sahrawat | 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) {
August 29th, 2009 | by
Amit Sahrawat | 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) {
August 29th, 2009 | by
Amit Sahrawat | 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) {