Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Submission C beader (haghet.h, my_atring.h) and soure (haghet. c, my_gtring.c) files, on Blackhoward. Description You wexl to have fini-hed Lah I to complete thi- aweigntent.

image text in transcribedimage text in transcribedimage text in transcribed

Submission C beader (haghet.h, my_atring.h) and soure (haghet. c, my_gtring.c) files, on Blackhoward. Description You wexl to have fini-hed Lah I to complete thi- aweigntent. Write the implementation file haghet.c for the interface in the given haghget. h header file. You may add additional functions or stroctures as becessay to implenent you tree get. haahget. h is attached as a file to this as-ignnent, but is ato li-ted bere for you convenience. You implementation file sould implement the set using a ha-h tablestructure. Sabmi-cions that impkenent the set witbout u-ing a ha-h table will bot recoive any credit. You will weed to add my_atring_equala awd my_atring_hagh fuaction to you my_atring module. For this ascignment, you will we a geometric smu like the one used by the fava which has "good enough" distribution properties and is relatively fast to compute. Thi- has the form h(8)=i=0m1Biam1i, (with a=31 ). You ta-h fusction makt ma in O(n) time (with n being the length of the string). This meas that you will not be able to compute the ooefficient for each term individually. Hint: try a rolling strategy where you compate a partial exponent and add in the next term. Cinder this scheme, the string "he110" has a hash coxle of 99162322 and the string "world" has a ha-h code of 11331802. The interface of your ha-h set will be simila to the ove for your tree set. You aize faxtion should run in constant time and the ingert, remove, and containa functions sbould all ran in O(1) amortized time. You will beed to recise you table as you add wew items. After you have impknented your tree get, write a function unique_worda that determibes how many unicue words are in the derignated file. Cinlike the one you wrote for you treeset aceignment, this one will always con-ider case. You do bot have to wony about panctuation (thi- has been removed from the files that will be wed to tet your program). In the provided copy of Romeo and Jabet, there are 1191 unigne words. At the top of your code you shouh have a comment sextion that ha- the following format: Computing II - CCMP. 1020 Honor Statement The practice of good ethical behavior ig eggential for maintaining good order in the claggroom, providing an enriching learning experience for gtudente, and ag training ag a practicing computing profegaicnal upen graduation. Thia practice ia manifeated in the Univergity? a fcademic Integrity policy. Studenta are expected to atrictly avoid academic dighonegty and adhere to the fcademic integrity policy ag outlined in 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Accounting questions