Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You must write a complete program that will read in the input file, and do the following: 1. Ignores case and converts everything to lower

You must write a complete program that will read  in the input file, and do the following:

1. Ignores case and converts everything to lower case.

2. Remove all double and single quotes, commas, question marks, colons, exclamation marks and periods from the document. Do not worry about dealing with contractions, just separate them into multiple words (eg "don’t" will be split into "don" and "t").

3. Prints the word and number of times it appears that appears the most number of times in the text excerpt. Ignore case. NOTE: If there are multiple words with the same maximum count, print the word that appears first in the text. NOTE: Only output a single integer for your answer.

4. Writes out the word counts into a file named "wordlist.txt". This file must contain 2 columns, the word then the word’s count, on the same line, with 1 word per line.

In this program, use hashing to solve the problem. You may implement your own hash table and your own hash function, or may rely on the programming language’s API and existing classes/data structures to do the hashing for you.

For each of the following pairs of functions f(n) and g(n), state whether f(n) = O(g(n)), f(n) = Q(g(n)), f(n) = (g(n)), or none of the above. (a) f(n) n^2+3n+4, g(n) = 5n+4 (b) f(n) =nvn, gin) n^2-n (c) f(n) = 2^n-n^2, g(n) = n^3+n^2 If n=3, n=2, C=1&C=2 Question 2. What is the difference between tree and binary tree? Question 3 (a,b,c). Which of the following initial condition is the best for Merge Sort? a) Random b) Nearly Sorted c) Reversed d) Few Unique What is the main difference between insertion sort and Selection Sort algorithm? a) Random b) Nearly Sorted c) Reversed d) Few Unique Which of the following initial condition is the best for Bubble Sort algorithm? a) Random b) Nearly Sorted c) Reversed d) Few Unique Question 4. What is the time complexity for Merge Sort algorithm? Question 5. Which of the following is the fastest sorting algorithm? a) Selection b)Bubble c)Merge d)Heap

Step by Step Solution

3.40 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

To accomplish the given task you can use Python to write a program that reads in the input file and ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Accounting

Authors: Floyd A. Beams, Joseph H. Anthony, Bruce Bettinghaus, Kenneth Smith

11th Edition

978-0132568968, 9780132568968

More Books

Students also viewed these Accounting questions

Question

2. Recognize progress and improvement. Avoid nonspecific praise.

Answered: 1 week ago

Question

What is meant by formal organisation ?

Answered: 1 week ago

Question

What is meant by staff authority ?

Answered: 1 week ago

Question

Discuss the various types of policies ?

Answered: 1 week ago

Question

Briefly explain the various types of leadership ?

Answered: 1 week ago