Posts

Data Structure Practical Slips from 1 to 15

Data Structure Practical Slips SLIP 1  Q.1. Data Structure A) Write menu driven program using ‘C’ for Binary Search Tree. The menu includes - Create a Binary Search Tree - Insert element in a Binary Search Tree - Display [20 M] B) Write a ‘C’ program to evaluate a given polynomial using function. (Use array). [10 M] SLIP 2 Q.1. Data Structure A) Write a ‘C’ program to accept a string from user and reverse it using Static implementation of Stack. [20 M] B) Write a ‘C’ program to create Circularly Doubly Linked list and display it. [10 M] SLIP 3 Q.1. Data Structure A)Write a program to create two singly linked list of elements of type integer and find the union of the linked lists. (Accept elements in the sorted order) [20 M] B) Write a ‘C’ program to read the adjacency matrix of directed graph and convert it into adjacency list. [10 M] SLIP 4 Q.1. Data Structure A) Write menu driven program using ‘C’ for Binary Search Tree. The menu includes - Create a Binary Search Tree - Traverse ...

Solutions for Questions in Practical Slips from 1 to 5

                                                       Slip 1 A) Write menu driven program using ‘C’ for Binary Search Tree. The menu includes - Create a Binary Search Tree - Insert element in a Binary Search Tree - Display  #include <stdlib.h> #include<stdio.h> #include <string.h> typedef struct node { struct node *leftchild; int info; struct node *rightchild; } NODE; NODE * get_node(int val) { NODE *p; p = (NODE*)malloc(sizeof(NODE)); Name: Class: Roll No: p->info=val; p->leftchild = p->rightchild = NULL; return p; } NODE* insert(NODE *h, int key) { NODE *p,*q; q = get_node(key); if(h==NULL) h = q; else { p = h; while(1) { if(p->info>q->info) { if(p->leftchild==0) { p->leftchild = q; break; } else p=p->leftchild; } else { if(p->rightchild==0) { p->rightchild = q; brea...