Here's the description in the .h file
Code:
/* Construct a dictionary of words. When you create it, you may request
** the dictionary keep the dictionary in sorted order (or not) for
** iteration **/
typedef enum { UNSORTED_ORDER, SORTED_ORDER } sorted_e;
Words* DictionaryConstruct (sorted_e sorted);
and more info in the .c file
Code:
Words* DictionaryConstruct (sorted_e sorted)
{
/* TODO: Don't use the the sorted_e ... should we ? Right now
** we always keep everything sorted, but we can make things
** faster if we don't have to keep them sorted... */
if (sorted==UNSORTED_ORDER) {
/* ?? */
}
Words* dummy = (Words*) malloc(sizeof(Words));
dummy->next = 0;
dummy->word = 0;
dummy->count = -1; /* Value to show we are at dummy node */
return dummy;
}
I don't quite understand what does the UNSORTED_ORDER and SORTED does here?? Say I have a file that is sorted and I call the function createDictionary on it then what does it do?