How to Create a Dictionary Using C++
Ok sowe’ll juststartright away.Hope thisguide helpsyoutofinishthe assignmentgivenbyou...
Wawan saidthat there isalsootheroption,toonlyinclude functionprototype inthe .hfile,andthe
implementationin.cpp.ButI prefe...
ExtraLinks
For the file streaminC++, you can learnfromthislink:
http://www.cplusplus.com/doc/tutorial/files/
Hope it helps...
Upcoming SlideShare
Loading in …5
×

How To Create Dictionary using C++

7,013 views

Published on

3 Comments
1 Like
Statistics
Notes
No Downloads
Views
Total views
7,013
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
80
Comments
3
Likes
1
Embeds 0
No embeds

No notes for slide

How To Create Dictionary using C++

  1. 1. How to Create a Dictionary Using C++ Ok sowe’ll juststartright away.Hope thisguide helpsyoutofinishthe assignmentgivenbyourlovely TA. Lol. These are my stepsinfinishingthe program(follow themif youwant,ignore itisfine also): 1. Learn howto create classin C++ (Iprefertoseparate my dictionaryintoclasses:1forthe LinkedList,1for the HashTable,andthe otheristhe mainclass). 2. Create the LinkedListclass. 3. Create the HashTable class. 4. Create the main(the .cpp) 5. DONE  Learnhow tocreate class inC++ ClassinC++ lookslike this(overall itissimilarjustlikeinJava): Save it as .h,you can accessthemby includingthemjustlikeanyotherlibraries.Example: #include ”myclass.h”
  2. 2. Wawan saidthat there isalsootheroption,toonlyinclude functionprototype inthe .hfile,andthe implementationin.cpp.ButI prefertodo it thisway. Create the LinkedList class Start by creatingthe LinkedListclass rightaway.Tofulfill the basicrequirement,youwill needtwo methods(toaddand to search) inthe LinkedListclass.Youcanuse your fallingcharactersprojectas reference forthe LinkedList,orjuststripitfrom the “C How To Program” book. For the word,you can create separate classfor word.Or justuse struct. It dependsonyou. Create the HashTable class Since we are usingseparate chaining,Icreate 26 LinkedListobjecttorepresenteach letter.LinkedList[0] for the wordstartingwith a…, LinkedList[1] forthe wordstartingwith b…, LinkedList[2] forthe word startingwith c…,until LinkedList[25] forthe wordstartingwith z…. Create the main class Finally inthe mainclass,include the HashTable class.Call the methodsfromHashTable class.DONE.
  3. 3. ExtraLinks For the file streaminC++, you can learnfromthislink: http://www.cplusplus.com/doc/tutorial/files/ Hope it helps 

×