2 q's re sedgewick's algorithms in c parts 1-4 book

B

ben

(this isn't going to make any sense unless you have sedgewick's
"algorithms in c parts 1-4" (but the 2nd question might make sense))


page 484, program 12.2 -- exactly what code/files should be used with
it in order to compile program 12.2?
there's two lines:
#include "Item.h"
#include "ST.h"
but it is not clear at all which files or code they are. i've had a
look on the book's support site and found all the code but there's no
indication of any file names. also i don't see 'Key' declared/typed/or
whatever the correct phrase is anywhere in all the code, not once.

so basically, what do i need in order to compile program 12.2?



also this bit i find very confusing (from page 612):

Suppose that the keys are words of a fixed length, all consisting of w
bits. Our requirement that keys are distinct implies that N <= 2^w, and
we normally assume that N is significantly smaller that 2^w, since
otherwise key-indexed search (see section 12.2) would be the
appropriate algorithm to use.

section 12.2 makes it clear that key-index searching is only useful for
very small table sizes. the above text makes it sound like key-indexed
searching would be appropriate if N was only slightly smaller that 2^w.
seems completely illogical. is that a basic english logic mistake or
have i misunderstood?

any help much appreciated.

thanks, ben.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top