In this assignment, you are asked to write a C function with the following signature that...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this assignment, you are asked to write a C function with the following signature that spell-checks its first input parameter (which is a string/char array) and returns 0 if it is not spelled correctly: int spell Check(char* word, char* dictionary FileName) {...} To perform spell-checking, you simply need to do binary search on the sorted list of English words given in their correct forms in the file entitled "dictionary.txt" available on Canvas along with the specification of this assignment. The name and path of this file is passed to your function as the second input parameter. Binary search can either be implemented using a binary search tree (taught in the class) or using an iterative algorithm like the following: int binsearch(char* dictionary Words[], int listSize,char* keyword) { int mid, low = 0, high = listSize - 1; while (high > low) { } mid (high+ low) / 2; if (strcmp(dictionary Words[mid],keyword) < 0) low = mid + 1; else if (strcmp(dictionary Words[mid],keyword)>0) high = mid-1; else return mid; } return -1;//not found In this assignment, you are asked to write a C function with the following signature that spell-checks its first input parameter (which is a string/char array) and returns 0 if it is not spelled correctly: int spell Check(char* word, char* dictionary FileName) {...} To perform spell-checking, you simply need to do binary search on the sorted list of English words given in their correct forms in the file entitled "dictionary.txt" available on Canvas along with the specification of this assignment. The name and path of this file is passed to your function as the second input parameter. Binary search can either be implemented using a binary search tree (taught in the class) or using an iterative algorithm like the following: int binsearch(char* dictionary Words[], int listSize,char* keyword) { int mid, low = 0, high = listSize - 1; while (high > low) { } mid (high+ low) / 2; if (strcmp(dictionary Words[mid],keyword) < 0) low = mid + 1; else if (strcmp(dictionary Words[mid],keyword)>0) high = mid-1; else return mid; } return -1;//not found
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
The controller of Northwest Hardware has just received two forecasts for sales in the Montana District for the coming year. Based on an econometric analysis of consumer spending and economic trends,...
-
How can managers determine whether a Deloitte employee is working at a decelerated pace in the career customization model or dimply isn't working very hard?
-
Tabitha often gets frustrated. She honks her horn and yells at other drivers and will throw her racket if she gets beat playing tennis.What would Tabitha probably be best describe ?
-
The scores and their percents of the final grade for a biology student are shown below. What is the students mean score? Find the weighted mean of the data. Score Percent of Final Grade Assignment 75...
-
The Lineberry Golf Cart Co. sold 7,400 carts this year at an average unit price of $3,000. Fifty days of sales remained uncollected in accounts receivable at the end of the year. The firm produced...
-
Johnson refused to file a federal income tax return, claiming that it was a violation of his right to privacy. He was arrested and charged with a violation of the Internal Revenue Code of the United...
-
Suppose an investor wishes to combine a T-bill, which offers the risk free rate of 4.1%, and shares in HPQ Inc. HPQ has an expected return of 11% and a standard deviation of 22%. The portfolio is to...
-
Can and do pension plans invest in foreign securities or tax-exempt securities?
-
a. What is the major legislation regulating pension funds! b. Does the legislation require every corporation to establish a pension fund?
-
Duration is a measure of the sensitivity of an asset or a liability to a change in interest rates. Why would bank management want to know the duration of its assets and liabilities?
-
Discuss ERISA's "prudent man" rule.
-
What is the difference between ordinary dividends and qualified dividends and how is each treated for tax purposes?
-
have public financial mangement questions 11 A flexible budget shows profitability under different assumptions of production volume 2 a True b False 2 The annualized cost method is used to evaluate...
-
What is the back work ratio? What are typical back work ratio values for gas-turbine engines?
-
Josun plc manufactures cereal based foods, including various breakfast cereals under private brand labels. In March the company had been approached by Cohin plc, a large national supermarket chain,...
-
A manufacturing company has provided you with the following data, which relate to component RYX for the period which has just ended: Overheads are absorbed at a rate per standard labour hour. (a) (i)...
-
One of the products manufactured by the company passes through two separate processes. In each process losses, arising from rejected material, occur. In Process 1, normal losses are 20 per cent of...
-
If two countries had identical term structures of interest rates, what is the expected future exchange rate change between the two currencies?
-
Pick three developing countries and create a country risk index for them. Rank them ordinally in terms of factors that you can observe (exports, GDP growth, reserves, etc.) by looking at...
-
Give examples of policies that a country could implement to reduce its absorption.
Study smarter with the SolutionInn App