11.07.2015 Views

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

366 Chap. 10 Indexingnumber of records th<strong>at</strong> can be stored in the file if a linear index of size2MB is used?(b) Wh<strong>at</strong> is the gre<strong>at</strong>est number of records th<strong>at</strong> can be stored in the file ifthe linear index is also stored on disk (<strong>and</strong> thus its size is limited only bythe second-level index) when using a second-level index of 4096 bytes(i.e., 1024 key values) as illustr<strong>at</strong>ed by Figure 10.2? Each element ofthe second-level index references the smallest key value for a disk blockof the linear index.10.3 Modify the function binary of Section 3.5 so as to support variable-lengthrecords with fixed-length keys indexed by a simple linear index as illustr<strong>at</strong>edby Figure 10.1.10.4 Assume th<strong>at</strong> a d<strong>at</strong>abase stores records consisting of a 2-byte integer key <strong>and</strong>a variable-length d<strong>at</strong>a field consisting of a string. Show the linear index (asillustr<strong>at</strong>ed by Figure 10.1) for the following collection of records:397 Hello world!82 XYZ1038 This string is r<strong>at</strong>her long1037 This is shorter42 ABC2222 Hello new world!10.5 Each of the following series of records consists of a four-digit primary key(with no duplic<strong>at</strong>es) <strong>and</strong> a four-character secondary key (with many duplic<strong>at</strong>es).3456 DEER2398 DEER2926 DUCK9737 DEER7739 GOAT9279 DUCK1111 FROG8133 DEER7183 DUCK7186 FROG(a) Show the inverted list (as illustr<strong>at</strong>ed by Figure 10.4) for this collectionof records.(b) Show the improved inverted list (as illustr<strong>at</strong>ed by Figure 10.5) for thiscollection of records.10.6 Under wh<strong>at</strong> conditions will ISAM be more efficient than a B + -tree implement<strong>at</strong>ion?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!