1. Store the words in a character array. 2. Sort the array 3. Print the sorted...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Store the words in a character array. 2. Sort the array 3. Print the sorted array for the user to see what words are available. 4. Then prompt the user for a word to find in the array (Hint: Always test with the first and last words in the array!) 5. Search the array using a sequential search (count the number of compares to determine if the word was in the array or not... test both ways) 6. Report the number of compares it took to find the word or decide the word was not in the array. 7. Then search the array using a binary search for the same word. (count the number of compares to determine if the word was in the array or not...test both ways) 8. Report the number of compares it took to find the word or decide the word was not in the array. 9. Loop back and ask the user for another word. 10. If the user enters "quit", then exit the program. Otherwise, do it again with a new word from the user. 1. Store the words in a character array. 2. Sort the array 3. Print the sorted array for the user to see what words are available. 4. Then prompt the user for a word to find in the array (Hint: Always test with the first and last words in the array!) 5. Search the array using a sequential search (count the number of compares to determine if the word was in the array or not... test both ways) 6. Report the number of compares it took to find the word or decide the word was not in the array. 7. Then search the array using a binary search for the same word. (count the number of compares to determine if the word was in the array or not...test both ways) 8. Report the number of compares it took to find the word or decide the word was not in the array. 9. Loop back and ask the user for another word. 10. If the user enters "quit", then exit the program. Otherwise, do it again with a new word from the user.
Expert Answer:
Answer rating: 100% (QA)
Answer 1 General guidance The answer provided below has been developed in a clear step by step manne... View the full answer
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these accounting questions
-
The length of a string in a Character array that has been declared as: Declare Chr[10] As Character is always 10. True or False
-
Write an application that counts the words in a String entered by a user. Words are separated by any combination of spaces, periods, commas, semicolons, question marks, exclamation points, or dashes....
-
Binary search of a sorted array takes logarithmic search time, but the time to insert a new element is linear in the size of the array. We can improve the time for insertion by keeping several sorted...
-
Jerome Neeson is a shareholder in Gourmet Chefs Inc., a company that owns and operates a test kitchen in a large metropolitan area. The company is involved in a number of businesses, including...
-
Heckman, an employee of Clark Equipment Company, severely injured his left hand when he caught it in a power press that he was operating at work. The press was manufactured by Federal Press Company...
-
(30 40) + 262/9 + 82/2 Perform the indicated operations by hand.
-
The directors are preparing the published accounts of Dorman plc for the year to 31 October 2005. The following information is provided for certain of the items which are to be included in the final...
-
Kelson Sporting Equipment, Inc., makes two different types of baseball gloves: a regular model and a catchers model. The firm has 900 hours of production time available in its cutting and sewing...
-
Advise Abby on her business include detailed analysis and recommendations. 75% 1 /2 + Lint January, Abby started a new business named Abby's Bands, Curtains, & Dining Essentials, or AllCEDE for sh...
-
Ray Flagg took out a 60-month fixed installment loan of $12,000 to open a new pet store. He paid no money down and began making monthly payments of $232. Ray's business does better than expected and...
-
A body was found in the basement of the Underwater Basket Weaving Building at 12:00 noon today, where the temperature is a steady 65 degrees Fahrenheit. When found, the core temperature was 92.2...
-
1. Name two types of companies that are more likely to choose to revalue non-current assets. Why? Provide examples 2. Discuss any managerial discretions available to the firms when...
-
(11) A 5 year $10,000 promissory note pays 6% compounded monthly. It was sold 3 years later to yield the purchaser 7% compounded quarterly. Find the proceeds of the note. please show your steps in...
-
If you expect to retire in 20 years, live on $60,000 per year and expect the inflation to average 3% over the next 20 years, what amount of annual income will you need to live at the same comfort...
-
Traditional athletic priorities and practices have begun to be challenged by a new set of standards premised on the notion that what have relevance in sport as well as other sectors of life. techno...
-
write at least three well composed paragraphs that describe the following capital budgeting calculations: Pay-back, Net Present Value (NPV), and Internal Rate of Return (IRR). Compare the...
-
A mild steel bar 5 0 0 mm long & 2 0 mm square in cross - section is subjected to ( a ) Gradual ( b ) Sudden load of 1 0 kN along length direction. Find strain energy in both cases.
-
It is possible to investigate the thermo chemical properties of hydrocarbons with molecular modeling methods. (a) Use electronic structure software to predict cHo values for the alkanes methane...
-
Prove that the slack form given to the PIVOT procedure and the slack form that the procedure returns are equivalent.
-
Find a simple formula for? (k-1). -k=1
-
Suppose we roll two ordinary, 6-sided dice. What is the expectation of the sum of the two values showing? What is the expectation of the maximum of the two values showing?
-
8. Ryder leased a truck to Florida Food Service; Powers, an employee, drove it to make deliveries. He noticed that the door strap used to close the rear door was frayed, and he asked Ryder to fix it....
-
9. A new truck, manufactured by General Motors Corp. (GMC), stalled in rush hour traffic on a busy interstate highway because of a defective alternator, which caused a complete failure of the truck's...
-
10. A prison inmate bit a hospital employee. The employee sued the state for negligence and lack of supervision, claiming a fear of AIDS. The plaintiff had tested negative for HIV three times, and...
Study smarter with the SolutionInn App