You are on page 1of 23

K L UNIVERSITY

FRESHMAN ENGINEERING DEPARTMENT


Department of BES-1
A Project Based Lab Report
On

Dictionary
SUBMITTED BY:
NAME ID NO.
1. RAHUL SARKAR 2100032538
2. SANJAY KUMAR 2100032540
3. NANDA KISHORE JANA 2100032541
4. HARSHITA SINHA 2100032560

UNDER THE ESTEEMED GUIDANCE OF


D. ANAND (SIR)
ASSISTANT PROFESSOR

KL UNIVERSITY
Green fields, Vaddeswaram – 522 502
Guntur Dt., AP, India.

1
DEPARTMENT OF BASIC ENGINEERING SCIENCES

CERTIFICATE

This is to certify that the project based laboratory report entitled “DICTIONARY”

submitted by SANJAY KUMAR, NANDA KISHORE, RAHUL SARKAR, HARSHITA SINHA,

Regd. No. 2100032540, 2100032541, 2100033538, 2100032560 to the Department of Computer Science

Engineering, KL University in partial fulfillment of the requirements for the completion of a project

based Laboratory in “Design of data structures” course in I B Tech I Semester, is a bonafide record

of the work carried out by him/her under my supervision during the academic year 2021 – 2022.

PROJECT SUPERVISOR HEAD OF THE DEPARTMENT

D. ANAND Dr. D. HARITHA

2
ACKNOWLEDGEMENTS

It is great pleasure for me to express my gratitude to our honorable President Sri. Koneru

Satyanarayana, for giving the opportunity and platform with facilities in accomplishing the project based
laboratory report.

I express the sincere gratitude to our Director Dr. A. Jagdeesh for his administration towards our
academic growth.

I express sincere gratitude to our Coordinator and HOD-BES Dr. D. Haritha for her leadership and
constant motivation provided in successful completion of our academic semester. I record it as my privilege
to deeply thank for providing us the efficient faculty and facilities to make our ideas into reality.

I express my sincere thanks to our project supervisor D. ANAND for his novel association of ideas,
encouragement, appreciation and intellectual zeal which motivated us to venture this project successfully.

Finally, it is pleased to acknowledge the indebtedness to all those who devoted themselves directly or
indirectly to make this project report success.

NAME ID NO.
1. RAHUL SARKAR 2100032538
2. SANJAY KUMAR 2100032540
3. NANDA KISHORE JANA 2100032541
4. HARSHITA SINHA 2100032560

3
ABSTRACT

In this paper we focus on the combinational properties of the Dictionary. To

create a dictionary as search a word, adding words, display the words and delete

the words.

In dictionary we see the spelling, pronunciation. Many languages can provide

A dictionary as a built-in datatypes; in others you find in a library that includes an

appropriate implementation that can use. Different language enforce different type

restrictions on keys and values in a dictionary.

4
INDEX

S.NO TITLE PAGE NO

1 Introduction 6

2 Aim of the Project 7

2.1 Advantages & Disadvantages 8

2.2 Future Implementation 8

3 Software & Hardware Details 9

4 Data Flow Diagram 10-11

5 Algorithm for each module 12

6 Implementation 13-16

7 Integration and System Testing 17-19

5
8 Conclusion 20

6
INTRODUCTION

Dictionary is one of the important Data Structures that is usually used to store data in the key-value
format. Each element presents in a dictionary data structure compulsorily have a key and some value is
associated with that particular key.
In other words, we can also say that Dictionary data structure is used to store the data in key-value
pairs. Other names for the Dictionary data structure are associative array, map, symbol table but
broadly it is referred to as Dictionary.

2A dictionary or associative array is a general-purpose data structure that is


used for the storage of a group of objects.

Many popular languages add Dictionary or associative array as a primitive data type in their
languages while other languages which don't consider Dictionary or associative array as a
primitive data type have included Dictionary or associative array in their software libraries. A direct
form of hardware-level support for the Dictionary or associative array is Contentaddressable
memory.

In Dictionary or associative array, the relation or association between the key and the value is
known as the mapping. We can say that each value in the dictionary is mapped to a particular key
present in the dictionary or vice-versa.

7
AIM

TO CREATE A DICTIONARY USING LINKED LIST .

1) Adding words
2) Searching words
3) Display dictionary
4) Deleting

ADVANTAGES

1. it is a variable reference in any organization because it provides


documentation.

2. It improves the communication between system analyst and user by


establishing consistent definitions of various items terms and procedures.

3. it is used to remove the redundancy in data definition.

4. it helps the analyst to simplify the structure for meeting the data requirement
of the system.

DISADVANTAGES

1. it does not provide functional details.

2. It is not acceptable to many nontechnical users.

8
FUTURE IMPLEMENTATION

To develop in the future is: 1. Spelling

2. Pronounciation

3. Vocabulary

SYSTEM REQUIREMENTS

➢ SOFTWARE REQUIREMENTS:

The major software requirements of the project are as follows:

Language: C language.

Operating system: Windows 8.0, 10 or 11 also can access.

Technical requirements: Monitor, CPU, Keyboard, Mouse, etc.

➢ HARDWARE REQUIREMENTS:

The hardware requirements that map towards the software are as follows:

RAM: 8 GB.

Processor: i5/i7.

9
DATA FLOW DIAGRAM

10
11
ALGORITHM

Step-1: Start.

Step-2: Read and write the words as per written on the output version.

Step-3: Assign dictionary words in the file.

Step-4: 1. Print and insert the words in dictionary.

2. Print and delete the words in dictionary.

3. Print and search the words from the dictionary.

4. Print and display words.

5. Print “exit”.

Step-5: Read selection.

Step-6: 1. Enter the words.

2. Enter the choices.

3: Enter and display the words sequencely.

Step-7: Print and open the file in the form of “dictionary.txt”.

Step-8: 1. Print and Draft saving in the form of file.

2. break.

Step-9: return.

Step-10: Stop.

12
IMPLEMENTATION

#include<stdio.h>

#include<string.h>

#include<stdlib.h>

struct node

char word[30];

struct node *nextpointer;

};

struct node *add(struct node* headnode,char n[40])

struct node *nnode;

nnode=(struct node*)malloc(sizeof(struct node));

strcpy(nnode->word,n);

nnode->nextpointer=NULL;

if(headnode==NULL)

headnode=nnode;

return headnode;

struct node *tempvalue=headnode;

while(tempvalue->nextpointer!=NULL)

tempvalue=tempvalue->nextpointer;

tempvalue->nextpointer=nnode;

13
return headnode;

struct node *delete(struct node *headnode,char n[40])

int foundvalue=0;

if(strcmp(headnode->word,n)==0)

foundvalue=1;

struct node *p=headnode;

headnode=headnode->nextpointer;

free(p);

else

struct node *curr=headnode->nextpointer;

struct node *prev=headnode;

while(curr!=NULL)

if(strcmp(curr->word,n)==0)

prev->nextpointer=curr->nextpointer;

free(curr);

foundvalue=1;

break;

14
prev=curr;

curr=curr->nextpointer;

if(foundvalue==0)

printf("Word not foundvalue\n");

else

printf("Word deleted successfully\n");

return headnode;

void search(struct node *headnode,char c)

struct node *tempvalue=headnode;

int cnt=0;

printf("Words in dictionary\n");

while(tempvalue!=NULL)

if(tempvalue->word[0]==c)

cnt++;

printf("%s\n",tempvalue->word);

tempvalue=tempvalue->nextpointer;

printf("\n");

15
if(cnt==0)

printf("No word foundvalue\n");

else

printf("Total words= %d\n",cnt);

void PrintList(struct node *nnode)

while(nnode != NULL)

printf("%s \n",nnode->word);

nnode= nnode->nextpointer;

int main()

FILE *fpvalue;

fpvalue=fopen("dictionary.txt","r");

char name[30];

struct node *headnode=NULL;

while(fgets(name,sizeof name,fpvalue) != NULL)

headnode=add(headnode,name);

fclose(fpvalue);

while(1)

16
{

printf("1: Insert word in dictionary\n");

printf("2: Delete word from dictionary\n");

printf("3: Search word from dictionary \n");

printf("4: display word \n");

printf("5: Exit\n");

printf("Enter choice: ");

int n;

scanf("%d",&n);

if(n==1)

printf("Enter the word: ");

char n[30];

scanf("%s",n);

headnode=add(headnode,n);

printf("Word added successfully\n");

else if(n==2)

printf("Enter the word to delete: ");

char n[30];

scanf("%s",n);

headnode=delete(headnode,n);

else if(n==3)

17
{

printf("Enter the starting letter of the word: ");

char ch;

scanf(" %c",&ch);

search(headnode,ch);

else if(n==4)

printf("Enter the display word: ");

PrintList(headnode);

else if(n==5)

FILE *f;

f=fopen("dictionary.txt","w");

struct node *tempvalue=headnode;

while(tempvalue!=NULL)

fputs(strcat(tempvalue->word,"\n"),f);

tempvalue=tempvalue->nextpointer;

printf("Data saved in file successfully\n");

break;

}}

return 0;

18
}

To activate it to work as code link is as follows: main.c

19
INTEGRATION AND SYSTEM TESTING
OUTPUTS

Screen Shots:

20
21
22
CONCLUSION

We have successfully completed the project “Dictionary” in simply way and given all

test cases and everything is passed.

23

You might also like