Write a program in C to make dictionary to add, delete
and search words Using linked lists.
MAKE THE SEARCHING IN THE program like the searching in the online
dictionary(if we enter the 1 letter then it will show all the
letters starting with the same number and if we enter 2 letters
then it will show all the numbers starting with same two letters
and so on up to the complete word.)
make the following functions
1. insert
2. delete
3. search
4. display
5. exit
use FILE HANDLING to store words in file
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
struct dict_entry{
char word[20];
char mean[300];
int synonym_count:
struct dict_entry* next;
struct dict_entry* synonym1;
struct dict_entry* synonym2;
struct dict_entry* synonym3;
struct dict_entry* synonym4;
struct dict_entry* synonym5;
struct dict_entry* head =NULL;
int option;
struct dict_entry* createNode(char word[] ,char meaning[]){
struct dict_entry *newNode = malloc(sizeof(struct dict_entry));
strcpy(newNode ->mean,meaning);
newNode -> synonym_count =0;
newNode -> synonym1=NULL;
newNode -> synonym2 =NULL;
newNode -> synonym3 =NULL;
newNode -> synonym4=NULL;
newNode -> synonym5 =NULL;
return newNode;
}
void displayDict(){
int i=1;
struct dict_entry* temp= head;
printf("\t word \t Defination\n*);
while(temp!=NULL){
printf("%d, %s - %s\n",i,temp->word,temp->mean);
i++;
temp =temp-> next:
}
printf("\n\n");
}
void linker2(struct dict_entry* src,struct dict_entry* dest,int number) {
switch (number) {
case 1:
src ->synonym1 =dest;
break;
case 2:
src ->synonym2=dest;
break;
case 3:
src ->synonym3=dest;
break;
case 4:
src ->synonym4=dest;
break;
case 5:
src ->synonym5=dest;
break;
}
}
///
void linker(struct dict_entry* src,struct dict_entry* dest){
if(src -> synonym_count <5){
src -> synonym_count++;
linker2(src,dest,stc -> synonym_count);
}
else{
printf("no space for a synonym");
}
}
void synonym_connecter(struct dict_entry* node,char arr[]){
struct dict_entry* temp=head;
int result = -1;
while(temp !=NULL){
result =strcmp(arr,temp ->word);
if(result ==0){
linker1(node,temp);
break;
}
temp =temp -> next;
}
if (result == -1){
printf("that word not found in dictionary");
}
}
void insert () {
struct dict_entry* temp = head;
char input_word[20]={'\0'};
char arr[300]={'\0'};
printf("enter your word ");
scanf("%s" , input_word);
while(temp!=NULL){
if(strcmp(input_word,temp->word)==0){
printf("same word found in dict\n");
return;
}
temp=temp ->next;
}
struct dict_entry* newN=createNode(input_word,arr);
if(head==NULL){
Ahead =newN;
}
else{
temp= head;
while(temp-> next !=NULL){
temp = temp ->next;
}
temp = temp ->newN;
}
int i;
displayDict():
printf("enter the synonym which are in the list");
//enter f to exit from loop
for(i=0;i<5;i++)
{
scanf("%s", input_word);
if(strcmp(input_word, "f")==0){
break;}
synonym_connector(newN,input_word);
}
return;
Write a program in C to make dictionary to add, delete and search words Using linked lists. MAKE THE SEARCHING IN THE pr...
write a C program to make the dictionary USING LINKED LISTS and STORE DATA in File HANDLING..... you have to create functions 1. insert 2. delete 3. search(if we search with any letter then the words with same first letter have been shown) 4. display 6. exit Appearance should be like proper dictionary.
write a C program to make the dictionary USING LINKED LISTS and STORE DATA in File HANDLING..... you have to create functions 1. insert 2. delete 3. search(if we search with any letter then the words with same first letter have been shown) 4. display 6. exit Appearance should be like proper dictionary.
write a c program to make a dictionary .... we add string in file and if we search with only one letter then print all its same first letter word and if we enter the complete name then print the only same number.....it can be done only with linked lists...
13inary Search Tree Using a binary search tree, you are tasked with building a dictionary program which you can store a word with its definition. Each node of the tree will contain the word and definition. The word is what will be used as the key to sort our data. The dictionary should allow you to search for a word. If the word exist then the definition will display. You can also add words to the dictionary. For testing you...
six options in the menu:Create a new dictionary.2. Add a word to a dictionary. 3. Delete a word from a dictionary. 4. Find a word in a dictionary. 5. Delete a dictionary. 6. Exit.each word represented by typedef struct Word { char** translations; struct Word* next; } Word;each dictionary represented bytypedef struct { char** languages; int numOfLanguages; Word* wordList; } Dictionary;languages will include a pointer to an array of strings so that the first word is the origin language and...
Goal: design and implement a dictionary. implement your dictionary using AVL tree . Problem: Each entry in the dictionary is a pair: (word, meaning). Word is a one-word string, meaning can be a string of one or more words (it’s your choice of implementation, you can restrict the meaning to one-word strings). The dictionary is case-insensitive. It means “Book”, “BOOK”, “book” are all the same . Your dictionary application must provide its operations through the following menu (make sure that...
Write the following C++ program that searches for specified words hidden within a matrix of letters. 1) Read a file that the user specifies. The file will first specify the dimensions of the matrix (e.g., 20 30). These two numbers specify the number of rows in the matrix and then the number of columns in the matrix. 2) Following these two numbers, there will be a number of rows of letters. These letters should be read into your matrix row...
Problem 1 This program is about dictionaries. We want to use a dictionary to store frequency count of each letter in a string. Write a Python program to do the following: (a) Ask the user to enter a string. Convert all letters to uppercase. Count the frequency of each letter in the string. Store the frequency counts in a dictionary. You should count letters only. Do not count any other characters such as digits and space. Display the dictionary. (b)...
Question 2: Finding the best Scrabble word with Recursion using java Scrabble is a game in which players construct words from random letters, building on words already played. Each letter has an associated point value and the aim is to collect more points than your opponent. Please see https: //en.wikipedia.org/wiki/Scrabble for an overview if you are unfamiliar with the game. You will write a program that allows a user to enter 7 letters (representing the letter tiles they hold), plus...
Write a program that searches for specified words hidden within a matrix of letters. C++ HELP -pls keep basic as possible, thanksssss 1. Read a file that the user specifies. The file will first specify the dimensions of the matrix (e.g., 20 30). These two numbers specify the number of rows in the matrix and then the number of columns in the matrix. 2. Following these two numbers, there will be a number of rows of letters. These letters should...