Saturday, April 30, 2011

TREE in Data Structure with C

TREEIt is a non-linear data structure that may contain several contents. In a tree the nodes are connected to each other a parent and child relationship where each parent node may have multiple children nodes but has exactly a single parent node. The node which has no parent at all is called a root node. All the other nodes in the tree are descendent of root node.Root node:- The only node which has no parent at all is called root node. But itself it is a parent of all other nodes in the tree.Leaf node – The node which has no child node at all are called leaf node/terminal node or external node.Non-leaf node – The node which has at least one child node are called non-leaf nod / non-terminal or internal node.Height of tree – The maximum distance of a leaf node form the root node is called height...

TREE in Data Structure with C

TREEIt is a non-linear data structure that may contain several contents. In a tree the nodes are connected to each other a parent and child relationship where each parent node may have multiple children nodes but has exactly a single parent node. The node which has no parent at all is called a root node. All the other nodes in the tree are descendent of root node.Root node:- The only node which has no parent at all is called root node. But itself it is a parent of all other nodes in the tree.Leaf node – The node which has no child node at all are called leaf node/terminal node or external node.Non-leaf node – The node which has at least one child node are called non-leaf nod / non-terminal or internal node.Height of tree – The maximum distance of a leaf node form the root node is called height...

Saturday, April 23, 2011

Queue Circular

#include "conio.h"#include "stdio.h"#include "stdlib.h"#define MAX 5struct cqueue{ int info[MAX]; int front, rear, count;} cq;int main(void){ int ch, n; cq.front = 0; cq.rear = -1; cq.count = 0; while(1) { clrscr(); f_disp(&cq); printf("\n\n1. Enqueue \n2. Dequeue\n3. Display\n4. Exit."); printf("\nEnter your choice : "); scanf("%d",&ch); switch(ch) { case 1: printf("Enter info : "); scanf("%d",&n); enqueue(&cq, n); break; case 2: n = dequeue(&cq); if(n!=-1) { printf("Dequeued : %d",n); getch(); } else { printf("Queue underflow..."); getch(); break; } break; case 3: disp(&cq); break; case 4: exit(0); default: printf("Invalid choice. \nPlease enter 1-4"); } } getch(); return 0;}/* add node to queue...

Queue (Priority)

/* priority queue */#include "conio.h"#include "stdio.h"#include "stdlib.h"struct q{ int info; struct q *next;} queue, *rear, *front;int main(void){ int n, ch; while(1) { clrscr(); f_disp(front); printf("\n\n1. Enqueue\n2. Dequeue\n3. Display\n4. Exit."); printf("\nEnter your choice : "); scanf("%d",&ch); switch(ch) { case 1: printf("Enter info : "); scanf("%d",&n); enqueuePqueue(front, n); break; case 2: n = dequeue(front); if(n!=-1) { printf("Dequeued : %d",n); getch(); } break; case 3: disp(front); break; case 4: exit(0); default: printf("Invalid choice. \nPlease enter 1-4"); } } getch(); return 0;}/* add node to queue list */enqueuePqueue(struct q *q, int n){ struct q *temp, *p = NULL; temp = (struct q*)malloc(sizeof(struct q));...

Queue Circular

#include "conio.h"#include "stdio.h"#include "stdlib.h"#define MAX 5struct cqueue{ int info[MAX]; int front, rear, count;} cq;int main(void){ int ch, n; cq.front = 0; cq.rear = -1; cq.count = 0; while(1) { clrscr(); f_disp(&cq); printf("\n\n1. Enqueue \n2. Dequeue\n3. Display\n4. Exit."); printf("\nEnter your choice : "); scanf("%d",&ch); switch(ch) { case 1: printf("Enter info : "); scanf("%d",&n); enqueue(&cq, n); break; case 2: n = dequeue(&cq); if(n!=-1) { printf("Dequeued : %d",n); getch(); } else { printf("Queue underflow..."); getch(); break; } break; case 3: disp(&cq); break; case 4: exit(0); default: printf("Invalid choice. \nPlease enter 1-4"); } } getch(); return 0;}/* add node to queue...

Queue (Priority)

/* priority queue */#include "conio.h"#include "stdio.h"#include "stdlib.h"struct q{ int info; struct q *next;} queue, *rear, *front;int main(void){ int n, ch; while(1) { clrscr(); f_disp(front); printf("\n\n1. Enqueue\n2. Dequeue\n3. Display\n4. Exit."); printf("\nEnter your choice : "); scanf("%d",&ch); switch(ch) { case 1: printf("Enter info : "); scanf("%d",&n); enqueuePqueue(front, n); break; case 2: n = dequeue(front); if(n!=-1) { printf("Dequeued : %d",n); getch(); } break; case 3: disp(front); break; case 4: exit(0); default: printf("Invalid choice. \nPlease enter 1-4"); } } getch(); return 0;}/* add node to queue list */enqueuePqueue(struct q *q, int n){ struct q *temp, *p = NULL; temp = (struct q*)malloc(sizeof(struct q));...

Queue Double (can insert through both end)

#include "conio.h"#include "stdio.h"#include "stdlib.h"typedef struct q{ int info; struct q *next;} queue;queue *rear, *front;int main(void){ int ch, n; clrscr(); while(1) { clrscr(); f_disp(front); printf("\n1. Enqueue rear\n2. Enqueue Front\n3. Dequeue front\n4. Dequeue rear\n5. Display\n6. Exit"); printf("\nEnter your choice : "); scanf("%d",&ch); switch(ch) { case 1: n = getinput(); enqueue_rear(rear,n); break; case 2: n = getinput(); enqueue_front(front, n); break; case 3: dequeue_front(front); break; case 4: dequeue_rear(front); break; case 5: disp(front); break; case 6: exit(0); default: printf("Invalid choice.\nPlease enter 1 - 6\n"); getch(); } }}int getinput(){ int n; printf("Enter the new info : "); scanf("%d",&n); return n;}enqueue_rear(queue...

Queue Double (can insert through both end)

#include "conio.h"#include "stdio.h"#include "stdlib.h"typedef struct q{ int info; struct q *next;} queue;queue *rear, *front;int main(void){ int ch, n; clrscr(); while(1) { clrscr(); f_disp(front); printf("\n1. Enqueue rear\n2. Enqueue Front\n3. Dequeue front\n4. Dequeue rear\n5. Display\n6. Exit"); printf("\nEnter your choice : "); scanf("%d",&ch); switch(ch) { case 1: n = getinput(); enqueue_rear(rear,n); break; case 2: n = getinput(); enqueue_front(front, n); break; case 3: dequeue_front(front); break; case 4: dequeue_rear(front); break; case 5: disp(front); break; case 6: exit(0); default: printf("Invalid choice.\nPlease enter 1 - 6\n"); getch(); } }}int getinput(){ int n; printf("Enter the new info : "); scanf("%d",&n); return n;}enqueue_rear(queue...

Queue (Dynamic implementation)

#include "conio.h"#include "stdio.h"#include "stdlib.h"typedef struct q{ int info; struct q *next;} queue;queue *rear, *front;int main(void){ int n, ch; while(1) { clrscr(); f_disp(front); printf("\n\n1. Enqueue\n2. Dequeue\n3. Display\n4. Exit."); printf("\nEnter your choice : "); scanf("%d",&ch); switch(ch) { case 1: printf("Enter info : "); scanf("%d",&n); enqueue(rear, n); break; case 2: n = dequeue(front); if(n!=-1) { printf("Dequeued : %d",n); getch(); } break; case 3: disp(front); break; case 4: exit(0); default: printf("Invalid choice. \nPlease enter 1-4"); } } getch(); return 0;}/* add node to queue list */enqueue(queue *s, int n){ queue *temp; temp = (queue *)malloc(sizeof(queue)); temp->info = n; temp->next = NULL;...

Queue (Dynamic implementation)

#include "conio.h"#include "stdio.h"#include "stdlib.h"typedef struct q{ int info; struct q *next;} queue;queue *rear, *front;int main(void){ int n, ch; while(1) { clrscr(); f_disp(front); printf("\n\n1. Enqueue\n2. Dequeue\n3. Display\n4. Exit."); printf("\nEnter your choice : "); scanf("%d",&ch); switch(ch) { case 1: printf("Enter info : "); scanf("%d",&n); enqueue(rear, n); break; case 2: n = dequeue(front); if(n!=-1) { printf("Dequeued : %d",n); getch(); } break; case 3: disp(front); break; case 4: exit(0); default: printf("Invalid choice. \nPlease enter 1-4"); } } getch(); return 0;}/* add node to queue list */enqueue(queue *s, int n){ queue *temp; temp = (queue *)malloc(sizeof(queue)); temp->info = n; temp->next = NULL;...

Queue (Static implementation)

/* static implementation of queue */#include "stdio.h"#include "conio.h"#include "stdlib.h"#define MAX 5typedef struct {int info[MAX];int front , rear;} queue;queue que;main(){int n, ch;clrscr();que.front = 0;que.rear = -1;while(1){clrscr();f_disp(que);puts("1. Enqueue\n2. Dequeue\n3. Display\4. Exit");printf("Enter your choice : ");scanf("%d",&ch);switch(ch){case 1: printf("Enter info : ");scanf("%d",&n);enqueue(&que, n);break;case 2: n = dequeue(&que);if(n!=-1)printf("Dequeued %d", n);elseprintf("Queue underflow...");getch();break;case 3: disp(que);break;case 4: exit(0);default : printf("Invalid choice.");}}}enqueue(queue *q, int n){if(q->rear == MAX){puts("Queue overflow...");getch();return;}q->info[++q->rear] = n;}dequeue(queue *q){int n;if(q->fornt > q->rear){puts("Queue...

Queue (Static implementation)

/* static implementation of queue */#include "stdio.h"#include "conio.h"#include "stdlib.h"#define MAX 5typedef struct {int info[MAX];int front , rear;} queue;queue que;main(){int n, ch;clrscr();que.front = 0;que.rear = -1;while(1){clrscr();f_disp(que);puts("1. Enqueue\n2. Dequeue\n3. Display\4. Exit");printf("Enter your choice : ");scanf("%d",&ch);switch(ch){case 1: printf("Enter info : ");scanf("%d",&n);enqueue(&que, n);break;case 2: n = dequeue(&que);if(n!=-1)printf("Dequeued %d", n);elseprintf("Queue underflow...");getch();break;case 3: disp(que);break;case 4: exit(0);default : printf("Invalid choice.");}}}enqueue(queue *q, int n){if(q->rear == MAX){puts("Queue overflow...");getch();return;}q->info[++q->rear] = n;}dequeue(queue *q){int n;if(q->fornt > q->rear){puts("Queue...

Wednesday, April 20, 2011

Evaluation of prefix expression

/* program on Evaluation of prefix expression */#include "stdio.h"#include "stdlib.h"#include "math.h"#define OPT 0#define OPND 1#define LP 2#define RP 3char infix[100], prefix[100]; /* global variables declare here */float val[26];struct stack{ float info; struct stack *next;} *stk;/* main function here */main(){ int i, type; char ch; clrscr(); printf("\nEnter a infix expression : "); scanf("%s",prefix); for(i=0;prefix[i]!='\0';i++) { ch = prefix[i]; type = gettype(ch); if(type == OPND) { printf("Enter value of %c : ",ch); scanf("%f",&val[ch-65]); } } printf("\nAfter evaluation: %f",(float)evalprefix()); getch();}/* push function here */push(struct stack *s, float n){ struct stack *temp; temp = (struct stack *)malloc(sizeof(struct stack)); temp->info = n; temp->next =...

Evaluation of prefix expression

/* program on Evaluation of prefix expression */#include "stdio.h"#include "stdlib.h"#include "math.h"#define OPT 0#define OPND 1#define LP 2#define RP 3char infix[100], prefix[100]; /* global variables declare here */float val[26];struct stack{ float info; struct stack *next;} *stk;/* main function here */main(){ int i, type; char ch; clrscr(); printf("\nEnter a infix expression : "); scanf("%s",prefix); for(i=0;prefix[i]!='\0';i++) { ch = prefix[i]; type = gettype(ch); if(type == OPND) { printf("Enter value of %c : ",ch); scanf("%f",&val[ch-65]); } } printf("\nAfter evaluation: %f",(float)evalprefix()); getch();}/* push function here */push(struct stack *s, float n){ struct stack *temp; temp = (struct stack *)malloc(sizeof(struct stack)); temp->info = n; temp->next =...

Evaluation of postfix expression

/* program on Evaluation of postfix expression */#include"stdio.h"#include"stdlib.h"#include"math.h"#define OPT 0#define OPND 1#define LP 2#define RP 3char infix[100], postfix[100]; /* global variables declare here */float val[26];struct stack{ float info; struct stack *next;} *stk;/* main function here */main(){ int i, type; char ch; clrscr(); printf("\nEnter a infix expression : "); scanf("%s",postfix); for(i=0;postfix[i]!='\0';i++) { ch = postfix[i]; type = gettype(ch); if(type == OPND) { printf("Enter value of %c : ",ch); scanf("%f",&val[ch-65]); } } printf("\nAfter evaluation: %f",(float)evalpostfix()); getch();}/* push function here */push(struct stack *s, float n){ struct stack *temp; temp = (struct stack *)malloc(sizeof(struct stack)); temp->info = n; temp->next...

Evaluation of postfix expression

/* program on Evaluation of postfix expression */#include"stdio.h"#include"stdlib.h"#include"math.h"#define OPT 0#define OPND 1#define LP 2#define RP 3char infix[100], postfix[100]; /* global variables declare here */float val[26];struct stack{ float info; struct stack *next;} *stk;/* main function here */main(){ int i, type; char ch; clrscr(); printf("\nEnter a infix expression : "); scanf("%s",postfix); for(i=0;postfix[i]!='\0';i++) { ch = postfix[i]; type = gettype(ch); if(type == OPND) { printf("Enter value of %c : ",ch); scanf("%f",&val[ch-65]); } } printf("\nAfter evaluation: %f",(float)evalpostfix()); getch();}/* push function here */push(struct stack *s, float n){ struct stack *temp; temp = (struct stack *)malloc(sizeof(struct stack)); temp->info = n; temp->next...

Infix expression to prefix expression conversion

/* program on conversion of infix to prefix expression */#include "stdio.h"#include "stdlib.h"#include "string.h"#define OPT 0#define OPND 1#define LP 2#define RP 3char infix[100], prefix[100]; /* global variables declare here */struct stack{char info;struct stack *next;} *stk;/* main function here */int main(void){clrscr();printf("\nEnter a infix expression : ");fflush(stdin);gets(infix);intopre();printf("\nPrefix expression is : %s", prefix);getch();return 0;}/* push function here */push(struct stack *s, char n){struct stack *temp;temp = (struct stack *)malloc(sizeof(struct stack));temp->info = n;temp->next = s;stk = temp;}/* Pop function here */char pop(struct stack *s){char ch;if(s!=NULL){ch = s->info;stk = s->next;free(s);}return ch;}/* ---- get character type here wheather...

Infix expression to prefix expression conversion

/* program on conversion of infix to prefix expression */#include "stdio.h"#include "stdlib.h"#include "string.h"#define OPT 0#define OPND 1#define LP 2#define RP 3char infix[100], prefix[100]; /* global variables declare here */struct stack{char info;struct stack *next;} *stk;/* main function here */int main(void){clrscr();printf("\nEnter a infix expression : ");fflush(stdin);gets(infix);intopre();printf("\nPrefix expression is : %s", prefix);getch();return 0;}/* push function here */push(struct stack *s, char n){struct stack *temp;temp = (struct stack *)malloc(sizeof(struct stack));temp->info = n;temp->next = s;stk = temp;}/* Pop function here */char pop(struct stack *s){char ch;if(s!=NULL){ch = s->info;stk = s->next;free(s);}return ch;}/* ---- get character type here wheather...

Infix expression to postfix expression conversion

/* program on conversion of infix to postfix expression */#include"stdio.h"#include"stdlib.h"#define OPT 0#define OPND 1#define LP 2#define RP 3char infix[100], postfix[100]; /* global variables declare here */struct stack{ char info; struct stack *next;} *stk;/* main function here */int main(void){ clrscr(); printf("\nEnter a infix expression : "); fflush(stdin); gets(infix); intopost(); printf("\nPostfix expression is : %s", postfix); getch(); return 0;}/* push function here */push(struct stack *s, char n){ struct stack *temp; temp = (struct stack *)malloc(sizeof(struct stack)); temp->info = n; temp->next = s; stk = temp;}/* Pop function here */char pop(struct stack *s){ char ch; if(s!=NULL) { ch = s->info; stk = s->next; free(s); } return ch;}/* get character type form infix...

Infix expression to postfix expression conversion

/* program on conversion of infix to postfix expression */#include"stdio.h"#include"stdlib.h"#define OPT 0#define OPND 1#define LP 2#define RP 3char infix[100], postfix[100]; /* global variables declare here */struct stack{ char info; struct stack *next;} *stk;/* main function here */int main(void){ clrscr(); printf("\nEnter a infix expression : "); fflush(stdin); gets(infix); intopost(); printf("\nPostfix expression is : %s", postfix); getch(); return 0;}/* push function here */push(struct stack *s, char n){ struct stack *temp; temp = (struct stack *)malloc(sizeof(struct stack)); temp->info = n; temp->next = s; stk = temp;}/* Pop function here */char pop(struct stack *s){ char ch; if(s!=NULL) { ch = s->info; stk = s->next; free(s); } return ch;}/* get character type form infix...

Monday, April 18, 2011

Stack Dynamic implemetation by Sweta Mam

...

Stack (Dynamic implemetation) by Sweta Mam

/* Stack Dynamic implemetation by Sweta Mam */#include"stdio.h"#include"stdlib.h"#include"conio.h"struct stack{int info;struct stack *next;}*front;int main(void){int n, ch;while(1){clrscr();puts("1. Push\n2. Pop\n3. Display\n4. Exit");puts("Enter your choice : ");scanf("%d",&ch);switch(ch){case 1: printf("Enter info : ");scanf("%d",&n);push(front, n);break;case 2: n = pop(front);if(n == -1){printf("\nPopped %d",n);getch();}break;case 3: disp(front);break;case 4: exit(0);default: puts("Invalid choice.");getch();}}return 0;}/* push function here */push(struct stack *s, int n){struct stack *temp;temp = (struct stack *)malloc(sizeof(struct stack));temp->info = n;temp->next = s;front = temp;}/* pop function here */pop(struct stack *s){int n;if(s==NULL){printf("Stack underflow.");return...

Stack Dynamic implemetation by Sweta Mam

...

Stack (Dynamic implemetation) by Sweta Mam

/* Stack Dynamic implemetation by Sweta Mam */#include"stdio.h"#include"stdlib.h"#include"conio.h"struct stack{int info;struct stack *next;}*front;int main(void){int n, ch;while(1){clrscr();puts("1. Push\n2. Pop\n3. Display\n4. Exit");puts("Enter your choice : ");scanf("%d",&ch);switch(ch){case 1: printf("Enter info : ");scanf("%d",&n);push(front, n);break;case 2: n = pop(front);if(n == -1){printf("\nPopped %d",n);getch();}break;case 3: disp(front);break;case 4: exit(0);default: puts("Invalid choice.");getch();}}return 0;}/* push function here */push(struct stack *s, int n){struct stack *temp;temp = (struct stack *)malloc(sizeof(struct stack));temp->info = n;temp->next = s;front = temp;}/* pop function here */pop(struct stack *s){int n;if(s==NULL){printf("Stack underflow.");return...

Stack static implementation program by Sweta Mam

/* Stack static implementation program by Sweta Mam */#include"conio.h"#include"stdio.h"#include"stdlib.h"#define MAX 5struct stack{int info[MAX];int top;} stk;int main(void){int n, ch;stk.top = -1;clrscr();while(1){clrscr();puts("\n\n1. Push\n2. Pop\n3. Display\n4. Exit.");printf("Enter your choice : ");scanf("%d",&ch);switch(ch){case 1: printf("Enter info : ");scanf("%d",&n);push(&stk, n);break;case 2: n = pop(&stk);if(n!=-1){printf("Popped : %d",n);getch();}break;case 3: disp(&stk);break;case 4: exit(0);default: puts("\nInvalid Input.\nPlease enter 1-4.");getch();}}}push(struct stack *s, int n){if(s->top == MAX-1){puts("Stack overflow.");getch();return;}s->info[++s->top] = n;}pop(struct stack *s){int n;if(s->top == -1){printf("Stack underflow.");getch();return;}n...

Stack static implementation program by Sweta Mam

/* Stack static implementation program by Sweta Mam */#include"conio.h"#include"stdio.h"#include"stdlib.h"#define MAX 5struct stack{int info[MAX];int top;} stk;int main(void){int n, ch;stk.top = -1;clrscr();while(1){clrscr();puts("\n\n1. Push\n2. Pop\n3. Display\n4. Exit.");printf("Enter your choice : ");scanf("%d",&ch);switch(ch){case 1: printf("Enter info : ");scanf("%d",&n);push(&stk, n);break;case 2: n = pop(&stk);if(n!=-1){printf("Popped : %d",n);getch();}break;case 3: disp(&stk);break;case 4: exit(0);default: puts("\nInvalid Input.\nPlease enter 1-4.");getch();}}}push(struct stack *s, int n){if(s->top == MAX-1){puts("Stack overflow.");getch();return;}s->info[++s->top] = n;}pop(struct stack *s){int n;if(s->top == -1){printf("Stack underflow.");getch();return;}n...

Circular Doubly link list program by Sweta mam

/* Circular Doubly link list program by sweta mam */#include"conio.h"#include"stdio.h"#include"stdlib.h"struct dclist{int info;struct dclist *next, *prev;} *st;void main(){int ch;clrscr();while(1){clrscr();f_disp(st);puts("\n\n1. Add\n2. Modify\n3. Delete\n4. Insert After");puts("5. Insert Before\n6. Display Forward\n7. Display Backward");puts("8. Save list to disk.\n9. Read from disk\n10. Exit.");printf("Enter your choice (1-9): ");scanf("%d",&ch);switch(ch){case 1: add(st); break;case 2: mod(st); break;case 3: del(st); break;case 4: ins_aft(st);break;case 5: ins_bef(st); break;case 6: disp_frd(st);break;case 7: disp_bck(st); break;case 8: save_list(st); break;case 9: read_list(st);break;case 10: exit(0);default: printf("Invalid option \n\tPlease enter 1 - 10\n");}}}/* Add function here...

Circular Doubly link list program by Sweta mam

/* Circular Doubly link list program by sweta mam */#include"conio.h"#include"stdio.h"#include"stdlib.h"struct dclist{int info;struct dclist *next, *prev;} *st;void main(){int ch;clrscr();while(1){clrscr();f_disp(st);puts("\n\n1. Add\n2. Modify\n3. Delete\n4. Insert After");puts("5. Insert Before\n6. Display Forward\n7. Display Backward");puts("8. Save list to disk.\n9. Read from disk\n10. Exit.");printf("Enter your choice (1-9): ");scanf("%d",&ch);switch(ch){case 1: add(st); break;case 2: mod(st); break;case 3: del(st); break;case 4: ins_aft(st);break;case 5: ins_bef(st); break;case 6: disp_frd(st);break;case 7: disp_bck(st); break;case 8: save_list(st); break;case 9: read_list(st);break;case 10: exit(0);default: printf("Invalid option \n\tPlease enter 1 - 10\n");}}}/* Add function here...

Doubly Link List (Menu based program) - Sweta Mam

/* Doubly link list by sweta mam */#include"conio.h"#include"stdio.h"#include"stdlib.h"struct dlist{int info;struct dlist *next, *prev;} *st;void main(){int ch;clrscr();while(1){ clrscr();f_disp(st);puts("\n\n1. Add\n2. Modify\n3. Delete\n4. Insert After");puts("5. Insert Before\n6. Display");puts("7. Save list to disk.\n8. Read from disk\n9. Exit.");printf("Enter your choice (1-9): ");scanf("%d",&ch);switch(ch){case 1: add(st); break;case 2: mod(st); break;case 3: del(st); break;case 4: ins_aft(st);break;case 5: ins_bef(st); break;case 6: disp(st);break;case 7: save_list(st); break;case 8: read_list(st);break;case 9: exit(0);default: printf("Invalid option \n\tPlease enter 1 - 9\n");}}}/* Add function here */add(struct dlist *s){struct dlist *temp;int n;temp = (struct dlist *)malloc(sizeof(struct...

Doubly Link List (Menu based program) - Sweta Mam

/* Doubly link list by sweta mam */#include"conio.h"#include"stdio.h"#include"stdlib.h"struct dlist{int info;struct dlist *next, *prev;} *st;void main(){int ch;clrscr();while(1){ clrscr();f_disp(st);puts("\n\n1. Add\n2. Modify\n3. Delete\n4. Insert After");puts("5. Insert Before\n6. Display");puts("7. Save list to disk.\n8. Read from disk\n9. Exit.");printf("Enter your choice (1-9): ");scanf("%d",&ch);switch(ch){case 1: add(st); break;case 2: mod(st); break;case 3: del(st); break;case 4: ins_aft(st);break;case 5: ins_bef(st); break;case 6: disp(st);break;case 7: save_list(st); break;case 8: read_list(st);break;case 9: exit(0);default: printf("Invalid option \n\tPlease enter 1 - 9\n");}}}/* Add function here */add(struct dlist *s){struct dlist *temp;int n;temp = (struct dlist *)malloc(sizeof(struct...

Saturday, April 9, 2011

Link List Program(Menu Based) By-Sweta Mam

#include"stdio.h"#include"stdlib.h"struct list{int info;struct list *next;}*st;FILE *fp;/* ----------------------- main function here --------------------------------*/int main(){int n;while(1){clrscr();f_disp(st);puts("\n\n1. Add\n2. Modify\n3. Delete");puts("4. Insert Before\n5. Insert After");puts("6. Display\n7. Save the list");puts("8. Read form disk\n9. Exit");fflush(stdin);printf("\nEnter your choice : ");fflush(stdin);scanf("%d",&n);switch(n){case 1: add(st); break;case 2: mod(st); break;case 3: del(st); break;case 4: ins_bef(st); break;case 5: ins_aft(st); break;case 6: disp(st); break;case 7: save_list(st); break;case 8: read_list(st); break;case 9: del_all(st); exit(0);break;default: puts("\nInvalid Input\nPlease enter 1-9");getch();}}}del_all(struct list *s){struct list *t;for(t=s;t!=NULL;t=s){s...

Link List Program(Menu Based) By-Sweta Mam

#include"stdio.h"#include"stdlib.h"struct list{int info;struct list *next;}*st;FILE *fp;/* ----------------------- main function here --------------------------------*/int main(){int n;while(1){clrscr();f_disp(st);puts("\n\n1. Add\n2. Modify\n3. Delete");puts("4. Insert Before\n5. Insert After");puts("6. Display\n7. Save the list");puts("8. Read form disk\n9. Exit");fflush(stdin);printf("\nEnter your choice : ");fflush(stdin);scanf("%d",&n);switch(n){case 1: add(st); break;case 2: mod(st); break;case 3: del(st); break;case 4: ins_bef(st); break;case 5: ins_aft(st); break;case 6: disp(st); break;case 7: save_list(st); break;case 8: read_list(st); break;case 9: del_all(st); exit(0);break;default: puts("\nInvalid Input\nPlease enter 1-9");getch();}}}del_all(struct list *s){struct list *t;for(t=s;t!=NULL;t=s){s...

Friday, April 1, 2011

IGNOU BCA Solved Assignment All Semesters 2011

Every course of each semester of IGNOU BCA consists of 2 parts - the first is semester wise examination and the other is the IGNOU Assignments. Both the parts are compulsory as well as important for the students to pass out successfully their semesters. It is very important for the students to submit the solved assignments to get promoted further. Therefore, I have posted some links to the solved assignments below.CS-06: Introduction to DBMSCS-60: Foundation Course in Mathematics and ComputingCS-610: Foundation Course in English for ComputingCS-611: Computer Fundamentals and PC Software Question PapersCS-612: PC Software SkillsCS-62: 'C' Programming & Data StructureCS-65: Window ProgrammingCS-66: MultimediaCS-72: C++ and Object Oriented ProgrammingCS-73: Theory...

IGNOU BCA Solved Assignment All Semesters 2011

Every course of each semester of IGNOU BCA consists of 2 parts - the first is semester wise examination and the other is the IGNOU Assignments. Both the parts are compulsory as well as important for the students to pass out successfully their semesters. It is very important for the students to submit the solved assignments to get promoted further. Therefore, I have posted some links to the solved assignments below.CS-06: Introduction to DBMSCS-60: Foundation Course in Mathematics and ComputingCS-610: Foundation Course in English for ComputingCS-611: Computer Fundamentals and PC Software Question PapersCS-612: PC Software SkillsCS-62: 'C' Programming & Data StructureCS-65: Window ProgrammingCS-66: MultimediaCS-72: C++ and Object Oriented ProgrammingCS-73: Theory...

Solved Assignment CS-60

There are five questions in this assignment. Answer all the questions. Question 1:  (i) Find the complex conjugate of (3+5i)/(1+2i) Here z = (3 + 5i)(1 + 2i)= 3 + 6i + 5i + 10(i x i)= 3 + 11i – 10= - 7 + 11iThen Complex conjugate of – 7 + 11i= - 7 – 11i (ii) Differentiate (sin x)x w.r.t. x.(iii) Find all the seventh roots of (3+4i).                                          (5 Marks)         &nb...

Page 1 of 24123Next
Related Posts Plugin for WordPress, Blogger...

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites