Posts

Showing posts from June, 2023

Implementation of AVL or Height Balance Tree using linked list in C++

 /* Name : Mosin Inamdar A Dictionary stores keywords & its meanings. Provide facility for adding new keywords, deleting keywords, updating values of any entry. Provide facility to display whole data sorted in ascending/ Descending order. Also find how many maximum comparisons may require for finding any keyword. Use Height balance tree and find the complexity for finding a keyword   */ #include<iostream> #include<cstring> #include<cstdlib> #define MAX 50 #define SIZE 20 using namespace std; struct AVLnode {     public:     char cWord[SIZE],cMeaning[MAX];     AVLnode *left,*right;     int iB_fac,iHt; }; class AVLtree {          public:         AVLnode *root;         AVLtree()         {             root=NULL;         }         int height(AVLnode*);     ...

Implementation of Binary search tree using Linked List in C++

 /* Name : Mosin Inamdar A Dictionary stores keywords & its meanings. Provide facility for adding new keywords, deleting keywords, updating values of any entry. Provide facility to display whole data sorted in ascending/ Descending order. Also find how many maximum comparisons may require for finding any keyword. Use Binary Search Tree for implementation.  */ #include<iostream> #include<string.h> using namespace std; typedef struct node {     char k[20];     char m[50];     class node *left;     class node *right; }node;   class dict {     public:     node *root;     void create();     void disp(node *);     void insert(node *,node *);     int search(node *,char[]);     int update(node *,char[]);     node *del(node *,char[]);     node *min(node *); }; void dict::create() {     class node *temp;     int c...