2016华南理工大学数据结构试卷A及答案 下载本文

time).Average seek time is defined to be 80 ms. Latency time is 0.5 *8.33, and cluster rotation time is 47.5*(16/144)*8.33.Seek time for the total file read time is

47* (80 + 0.5 * 600/72+ (16/144)*600/72)+(80+0.5*600/72+(8/144*600/72))=4083.98ms

10. Using closed hashing, with double hashing to resolve collisions, insert the following keys into a hash table of eleven slots (the slots are numbered 0 through 10). The hash functions to be used are H1 and H2, defined below. You should show the hash table after all eight keys have been inserted. Be sure to indicate how you are

using H1 and H2 to do the hashing. ( The process of your solution is required!!!) H1(k) = 3k mod 11 H2(k) = 7k mod 10+1

Keys: 22, 31, 18, 35, 44, 13, 1, 67. (8 scores) Answer:

H1(22)=0, H1(31)=5, H1(18)=10, H1(35)=6, no conflict

When H1(44)=0, H2(44)=9 (0+9*1)=9,so 44 enters the 9rd slot; H1(13)=6, H2(13)=2 (6+1*2)=8, so 13 enters the 8th slot; H1(1)=3, so 1 enters 3 ;

H1(67)=3, H2(67)=10 (3+2*10)= 1 so 67 enters 1(pass by 2) 22 0 11.

1 67 2 1 3 4 31 5 35 6 7 13 8 44 9 18 10 3 4 20 1 10 2 6 11 3 3 5 15 Figure 1 Example graph

(a) find the shortest paths from Vertex1 to all the other vertices. (3)

(b) Use Kruskal’s algorithm to find the minimum-cost spanning tree. (3)

10 2 5

(a) 1 to 2: 10 (1,2);

1 to 3: 13(1,2,3); 1 to 4: 12 (1,6,4); 1 to 5: 5 (1,6,5); 1 to 6: 2 (1,6,);

(b)

2 10 1 2 3 3 5 4 6 3 5

(资料素材和资料部分来自网络,供参考。可复制、编制,期待你的好评与关注)