عاوز اعمل برنامج لقاموس بال console application بس
ممكن حد يساعدنى دا البرنامج اهو
dictioanries : bulid an maintain a data structure to efficiently locate , insert , or delete the record associated with any query key q.
implement dictionary using data structure from list blow:
a. unsorted linked lists or arrays - for small data sets ,say up to 10 to 20 items ,an unsorted array is probably the easiest and most effient data structure to maintain. they are easier to work with than linked lists, and if dictionary will be kept this small , you cannot possibly save a significant amount of space over alllocating afull array. if your dictionary will be too much larger , the search time will kill you in either case.
b. A particularly interesting and useful variant is aslef - organizing list. whenever akey is accessed or inserted always move it to head of the list. thus if the key is accessed again in the near future it will be near the front an so require only ashort search to find it . since most applications exhibit both uneven access frequencies and locality of reference , the average search time for asuccessfull search in aself -organizing list is typically much better than in asorted or unsorted list. of course ,self -organizing data strutures can be bulit from arrays as well as linked lists.
c. sorted linked lists or arrays -maintaning asorted linked list is usually not worth the effort (unless you are trying to eliminate duplicates) , since we cannot perform binary search it such a data struture . A sorted array will be appropriate if and only if there are not many insertions or deletions . when the array gets so large that it doesn't fit in real momery , think b-trees instead