Posts

How to be a good Programmer?

This is the question you always want to answer to someone but you didn't get it yet yourself. First I clear one thing that i am not a good programmer and not the writer at all but i can say i am still learning. Yes I am better than quite a few people when it comes to programming, but that's merely because they are lazy and like to sit on idly all day and never bother about programming. Their horrible skills make my less horrible skills look marvelous. Things that's help you to be a good programmer mention below  they are what I have wanted to be and I am not. So lets dive in. 1.Decide why you want to become a good programmer this is the main question you have to ask yourself  Is it because you want a job, preferably in a high paying software firm? Great. Then you are set to reach NOWHERE. All good programmers I know are good because they loved what they did. 2. Programming languages Very often people equate good coding skills with number of programming langauges k...

THIS PROGRAM SEARCHS AN ITEM FROM SIMPLE LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; int num; struct list start, *prev, *new1; void search(struct list *); void create_list(struct list *); void display(struct list *);  /* Function to create linked list */  void create_list(struct list *ptr) {     int n;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n ==============================================================================\n");     while( i!=n)     {  ...

THIS PROGRAM INSERTS A NODE AT THE END OF SIMPLE LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; int num; struct list start, *prev, *new1; void insert_last(struct list *); void create_list(struct list *); void display(struct list *);  /* Function to create linked list */  void create_list(struct list *ptr) {     int n;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n ==============================================================================\n");     while( i!=n)     { ...

THIS PROGRAM INSERTS A NODE AT THE BEGINNING OF SIMPLE LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; int num; struct list start, *prev, *new1; void insert_first(struct list *); void create_list(struct list *); void display(struct list *); /* Function to create linked list */  void create_list(struct list *ptr)  {     int n;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n ==============================================================================\n");     while( i!=n)     { ...

THIS PROGRAM DELETES LAST NODE FROM SIMPLE LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     char info;     struct list *link; }; int i; int num ; struct list start, *prev; void del_last(struct list *); void display(struct list *); void create_list(struct list *); /* Function to create linked list */  void create_list(struct list *ptr) {     int n;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n ==============================================================================\n");     while( i!=n)     {   ...

THIS PROGRAM DELETES FIRST NODE FROM SIMPLE LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; struct list start, *prev; void create_list(struct list *); void display(struct list *); void del_first(struct list *); /* Function to create linked list */  void create_list(struct list *ptr)  {     int n;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n ==============================================================================\n");     while( i!=n)     {     ...

THIS PROGRAM CREATES A HEADER LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; int num; struct list *start, *new1; void insert(struct list *); void create_hlist(struct list *); void display (struct list *); /* Function to create a header linked list */ void create_hlist(struct list *ptr) {     int n;     start->link = NULL;  /* Empty list1 */     ptr = start;      /* Point to the header ptr of the list1 */     ptr->link = (struct list* ) malloc(sizeof(struct list)); /* Create header ptr */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");  ...

THIS PRORAM PERFORMS INSERTOIN AT THE END OF DOUBLY LINKED LIST

#include<stdio.h> #include<malloc.h> struct dlist {     char info[20];     struct dlist *link;     struct dlist *prev; }; int i; struct dlist  start, *new1; void insert_last (struct dlist *); void create_dlist (struct dlist *); void display (struct dlist *); /* Function to create doubly linked list */  void create_dlist(struct dlist *ptr) {     int n;     start.link = NULL;  /* Empty list */     start.prev = NULL;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n\n\n How many nodes you want to create: ");     scanf("%d",&n);     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter string values in nodes\n");     printf("\n ===========...

THIS PROGRAM DELETES THE LAST NODE FROM DOUBLY LINKED LIST

#include<stdio.h> #include<malloc.h> struct dlist {     int info;     struct dlist *link;     struct dlist *prev; }; int i ; struct dlist start, *prev; void del_last (struct dlist *); void create_dlist (struct dlist *); void display (struct dlist *);  /* Function to  create doubly linked list */ void create_dlist(struct dlist *ptr) {     int n;     start.link = NULL;  /* Empty list */     start.prev = NULL;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in nodes\n");     printf("\n =======================...

THIS PROGRAM DELETES A NODE FROM GIVEN LOCATION OF DOUBLY LINKED LIST

#include<stdio.h> #include<malloc.h> struct dlist {     int info;     struct dlist *link;     struct dlist *prev; }; int i ; struct dlist start; void del_node (struct dlist *); void create_dlist (struct dlist *); void display (struct dlist *); /* Function to  create doubly linked list */ void create_dlist(struct dlist *ptr) {     int n;     start.link = NULL;  /* Empty list */     start.prev = NULL;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n =====================================...

THIS PROGRAM CREATES A SIMPLE LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; struct list start; void create_list(struct list *); void display(struct list *); /* Function to create linked list */  void create_list(struct list *ptr) {     int n;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n ==============================================================================\n");     while( i!=n)     {         ptr->link = (struct lis...

THIS PROGRAM INSERTS A NODE AT GIVEN LOCATION IN SIMPLE LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; int num; struct list start, *prev, *new1; void insert_node(struct list *); void create_list(struct list *); void display(struct list *);  /* Function to create linked list */  void create_list(struct list *ptr)  {     int n;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n ==============================================================================\n");     while( i!=n)   ...

THIS PROGRAM INSERTS AN ITEM INTO SORTED LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; int num; struct list start, *prev, *new1; void insert_node(struct list *); void create_list(struct list *); void display(struct list *); /* Function to create linked list */  void create_list(struct list *ptr)  {     int n;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node in ASCENDING ORDER\n");     printf("\n ==============================================================================\n");     while( i!=n) ...

THIS PROGRAM DELETES A NODE AT GIVEN LOCATION FROM SIMPLE LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; int num ; struct list start, *prev; void  del_node(struct list *); void  create_list(struct list *); void display(struct list *); /* Function to create linked list */  void create_list(struct list *ptr)  {     int n;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n ==============================================================================\n");     while( i!=n)     {...

THIS PROGRAM DELETES AN ITEM FROM SIMPLE LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; int num ; struct list start, *prev; void del_node(struct list *); void  create_list(struct list *); void display(struct list *); /* Function to create linked list */ void create_list(struct list *ptr)  {     int n;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     i=0;     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n ==============================================================================\n");     while( i!=n)     {  ...

THIS PROGRAM CREATES STRING TYPE LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     char info[20];     struct list *link;     struct list *prev; }; int i ; struct list start; void create_list (struct list *); void display (struct list *);  /* Function to create linked list */  void create_list(struct list *ptr) {     int n;     start.link = NULL;  /* Empty list */     start.prev = NULL;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n\n\n How many nodes you want to create: ");     scanf("%d",&n);     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter string values in nodes\n");     printf("\n ====================================================================...

THIS PROGRAM PERFORMS INSERTION AT THE BEGINNING OF DOUBLY LINKED LIST

#include<stdio.h> #include<malloc.h> struct dlist {     char info[20];     struct dlist *link;     struct dlist *prev; }; int i; struct dlist  start, *new1; void insert_first (struct dlist *); void create_dlist (struct dlist *); void display (struct dlist *); /* Function to create doubly linked list */ void create_dlist(struct dlist *ptr) {     int n;     start.link = NULL;  /* Empty list */     start.prev = NULL;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n\n\n How many nodes you want to create: ");     scanf("%d",&n);     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter string values in nodes\n");     printf("\n ================...

THIS PROGRAM DELETES FIRST NODE OF DOUBLY LINKED LIST

#include<stdio.h> #include<malloc.h> struct dlist {     char info[20];     struct dlist *link;     struct dlist *prev; }; int i ; struct dlist start; void del_first (struct dlist *); void create_dlist (struct dlist *); void display (struct dlist *);  /* Function to create doubly linked list */  void create_dlist(struct dlist *ptr) {     int n;     start.link = NULL;  /* Empty list */     start.prev = NULL;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n\n\n How many nodes you want to create: ");     scanf("%d",&n);     printf("\n\n ==============================================================================\n");     printf("\n Note That:\n -----------\n Enter string values in nodes\n");     printf("\n ===================...

WRITE A PROGRAM TO CREATES CIRCULAR HEADER LINKED LIST

#include<stdio.h> #include<malloc.h> struct list {     int info;     struct list *link; }; int i; int number; struct list *start, *new1; void create_list(struct list *); void display(struct list *); /* Function to create a circular header linked list */ void create_list( struct list *ptr) {     int n;     ptr = start;      /*ptr points to the header node */     ptr->link = (struct list *) malloc(sizeof(struct list));     i = 0;     printf("\n\n\n how many nodes you want to create: ");     scanf("%d",&n);     printf("\n\n =======================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n =======================================================\n");     while(i!=n)     { ...

WRITE A PROGRAM TO CREATES A SIMPLE DOUBLY LINKED LIST

#include<stdio.h> #include<malloc.h> struct dlist {     int info;     struct dlist *link;     struct dlist *prev; }; int num ; struct dlist start; void create_dlist (struct dlist *); void display (struct dlist *); /* Function to creates doubly linked list */ void create_dlist(struct dlist *ptr) {     int n,i=0;     start.link = NULL;  /* Empty list */     start.prev = NULL;     ptr = &start;      /* Ptr points to the start pointer */     printf("\n How many nodes you want to create: ");     scanf("%d",&n);     printf("\n\n =======================================================\n");     printf("\n Note That:\n -----------\n Enter numeric data in node\n");     printf("\n =======================================================\n");     while( i!=n...