Looking up a word in a dictionary can be a complicated process. For example, assume you want to look up “logic.” You might open the dictionary to a random page and see “juice.” You know this word comes alphabetically before “logic,” so you flip forward and see “lamb.” That is still not far enough, so you flip forward and see “monkey.” You have gone too far, so you flip back, and so on. Draw a structured flowchart or write pseudocode that describes the process of looking up a word in a dictionary. Pick a word at random and have a fellow student attempt to carry out your instructions To search a word in dictionary, we use binary search as the data is sorted. The same concept has been specified in given problem. Read more about binary search here: http://rosettacode.org/wiki/Binary_search You can google too. What here is being refereed by random, you can pick any word from dictionary. There is no need to write pesudo code to get random word from dictionary. Pesudocode is written in native code language so there are needed few programming constructs to use like arrays and loops. If you want to look at algorithm, see algorithm after pseudocode. You can use either.

To conduct a structured search for a word in a dictionary, you can utilize the binary search algorithm due to the sorted nature of the data. The process can be summarized in the following pseudocode:

1. Begin by initializing the lower bound (low) as the first index of the dictionary and the upper bound (high) as the last index of the dictionary.
2. Calculate the midpoint (mid) between the low and high bounds by taking the average of the two.
3. Retrieve the word located at the midpoint index.
4. Compare the retrieved word with the word being searched.
5. If the retrieved word matches the word being searched, the search is complete and the location of the word in the dictionary is returned.
6. If the retrieved word comes before the word being searched alphabetically, update the lower bound to mid + 1 and repeat steps 2-6.
7. If the retrieved word comes after the word being searched alphabetically, update the upper bound to mid – 1 and repeat steps 2-6.
8. Repeat steps 2-7 until either the word is found or the lower bound surpasses the upper bound, indicating that the word is not present in the dictionary.

It must be noted that the pseudocode provided assumes a correctly sorted dictionary and will not work if the data is not arranged alphabetically.

Here is an example implementation of the pseudocode for searching the word “logic” in a dictionary:

“`
function binarySearch(dictionary, word):
low = 0
high = length(dictionary) – 1

while low <= high: mid = floor((low + high) / 2) retrievedWord = dictionary[mid] if retrievedWord == word: return mid elif retrievedWord < word: low = mid + 1 else: high = mid - 1 return -1 ``` With this pseudocode, a fellow student can follow the instructions by providing a sorted dictionary and calling the binarySearch function with the desired word. The function will return the index of the word in the dictionary if found, or -1 if not present. To further analyze the efficiency of the binary search algorithm, we can observe that in each iteration, the search space is halved. This results in a logarithmic time complexity of O(log n), where n is the size of the dictionary. Binary search is highly efficient when searching for a specific word in a large dictionary compared to a linear search, which has a time complexity of O(n) in the worst case.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer