Hash2

  • Uploaded by: johannes
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Hash2 as PDF for free.

More details

  • Words: 1,017
  • Pages: 7
Bilangan Prima < 200 adalah : 46 buah 2.3.5.7.11.13.17.19.23.29 31.37.41.43.47.53.59.61.67.71 73.79.83.89.97.101.103.107.109.113 127.131.137.139.149.151.157.163.167.173 179.181.191.193.197.199 1. Masukkan ke dalam hash dengan ukuran table hash = 47; h(x) = x mod 47, Gunakan resolusi linear. Hitung waktu akses rata

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

47

191.(6) 2

3

97.(2 )

5

53

7

101.(2 )

103

149.(2 )

11

59

13

61

22

2 3

2 4

25

2 6

27

28

29

2 3

7 1

163.(3 )

7 3

16 7

193.(33 )

29

15

16

1 7

18

1 9

2 0

21

107.(3 )

109.(2 )

1 7

151.(8 )

1 9

6 7

113.(3) 157.(6 )

30

3 1

3 2

33

34

35

3 6

3 7

38

39

197.(29 )

3 1

7 9

12 7

173.(2 )

199.(32 )

8 3

3 7

131.(2 )

17 9

4 0

4 1

4 2

4 3

44

45

46

4 1

8 9

4 3

13 7

181.(5 )

139

Waktu akses Rata – rata : ( 6 + 2 + 2+2+3+2+8+3+6+3+33+29+2+32+2+5)/47 = 140/47 = 2.978

2. tabel Utama ukuran 29 ( h(x) = x mod 29) 0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

29

59

2

3

89

61

149

7

37

181

11

41

13

43

15

16

17

18

19

20

21

22

23

24

25

71

101

17

47

19

163

193

107

23

53

139

26

27

28

83

113

Overflow1 ukuran 17 ( h(x) = x mod 17) 0

1

2

10 3

13 7

3

4

5

6

73

7

8

9

10

11

12

10 9

59

19 7

17 9

79

97

Overflow2 ukuran 11 ( h(x) = x mod 11) 0 1 2 3 4

5

191

127

173

157

Resolusi linear : H(x)= ( h(x) + 1 mod n ) H(173) = ( 173 + 4 mod 11 = 1 ) Waktu akses rata – rata : 19 / 46 = 0.412

3. a). Ukuran Index ( terbuka) = 7 Ukuran Index ( tertutup) = 7

6

13

14

15

16

31

16 7

67

7

8

9

151

199

131

10

0

1

2

3

4

5

6

0

7

79

107

149

163

181

191

1

29

43

71

101

157

199

2

151

179

2

23

37

109

137

3

73

89

103

3

17

31

59

4

11

53

67

83

97

139

167

5

47

61

193

5

19

6

13

41

113

173

197

127

131

Resolusi linear : H(x)= ( h(x) + 1 mod n ) H(131) = ( h(131) +1 mod 7 = 6 H(173) = (h(173)+1 mod 7 = 6 H(181) = (h(181)+1 mod 7 = 0 H(193) = ( h(193) + 1 mod 7 = 5 Waktu rata – rata = (2 + 3+4+5+6+7+2+3+4+5+6+6+7+2+2+3+4+5+5+6+7+2+3+4+2+3+4+5+6+7+3+4+5+2+2+3+4 +5+6+7)/46 = 288/46 = 6,26

B). Beda Rumus a).H1(x)= (x+1) mod 7

0

1

2

3

4

5

6

0

13

71

79

107

149

163

191

1

7

43

101

157

199

2

151

2

29

37

73

109

137

3

67

89

103

3

23

31

59

4

17

53

83

97

139

167

181

5

47

61

179

193

5

11

6

19

41

113

127

173

197

131

Resolusi linear : H(x)= ( h(x) + 1 mod n ) H(131) = ( h (131) + 1 mod 7 = 6 H( 173 )= ( h ( 173 ) + 1 mod 7 = 6 H( 179 ) = ( h(179) + 1 mod 7= 5 Waktu rata – rata = ( 169 / 46 = 3,673 )

b).h(x) = (x+2) mod 7

0

1

2

3

4

5

6

0

17

47.(2)

61.(3)

89.(4)

103.(5)

139.(6)

167(7)

1

11

41.(2)

83.(3)

97.(4)

179(5)

181(6)

193(7)

2

7.(2)

19.(3)

197(4)

2 3

71.(5)

113.(6)

127.(7)

3

13.(2)

29.(3)

43.(4)

4

107.(4)

157(5)

191(6)

199(7)

23

37.(2)

79.(3)

5

59.(3)

73.(4)

101.(5)

137.(6)

151(7)

5

31.(2)

6

53

67.(2)

109.(3)

131.(4)

149(5)

163(6)

173(7)

Resolusi linear : H(x)= ( h(x) + 1 mod n ) H(149) = ( h(149) + 1 mod 7 = 6 H( 163) = ( h(163) + 1 mod 7 = 6 H( 179) = ( h(179) + 1 mod 7 = 1 H( 181) = ( h (181) + 2 mod 7 = 1 H( 191) = ( h ( 191) + 2 mod 7 = 4 H(193) = ( h (193)+1 mod 7 = 1

Waktu rata rata = 171 / 46 = 3,717

c). H(x) = (x+6)mod 7

0

1

2

3

4

5

6

0

29

37.(2)

101.(3)

113.(4)

127.(5)

149.(6)

151.(7)

1

23

31.(2)

59.(3)

73.(4)

109.(5)

137.(6)

173.(7)

2

131.(6)

167.(7)

2

17.(2)

53.(3)

67.(4)

103.(5)

3

83.(5)

97.(6)

139.(7)

3

11.(2)

47.(3)

61.(4)

4

19

41.(2)

179(3)

193(4)

197(5)

199(6)

5

163.(3)

181(4)

191(5)

6

7

17.(2)

43.(3)

71.(4)

Resolusi Linear : H(x) = h(x) + 6 mod 7 H(179) = H( 179 ) + 7 mod 7 = 4 H(181) = H ( 181 ) + 6 mod 7 = 2 H( 193) = H ( 193) + 7 mod 7 = 4 H( 199) = H ( 199) + 8 mod 7 = 4

Waktu rata – rata = 169 / 46 = 3,673

d). H(x) = ( x + 8 ) mod 7

79.(5)

5

13.(2)

107.(6)

157.(7)

0

1

2

3

4

5

6

0

13

41.(2)

113.(3)

127.(4)

149.(5)

157.(6)

199(7)

1

7

71.(2)

107.(3)

179.(4)

193(5)

197(6)

2

151.(6)

173.(7)

2

29.(2)

43.(3)

79.(4)

101.(5)

3

109.(5)

137.(6)

167.(7)

3

23.(2)

37.(3)

73.(4)

4

17

31.(2)

59.(3)

67.(4)

89.(5)

103.(6)

131.(7)

5

53.(3)

61.(4)

83.(5)

97.(6)

139.(7)

5

11.(2)

6

19

47.(2)

163.(3)

181(4)

191(5)

Overflow pada bilangan prima 181 H(x) = ( x + 8 ) mod 7 H(181) = ( 181 + 8 mod 7 = 6) H ( 197) = ( 197 + 8 mod 7 = 1) Waktu rata – rata = 169 / 46 = 3.673

Related Documents

Hash2
November 2019 12

More Documents from "johannes"

Bab 4 Teori Akuntansi.docx
November 2019 12
Hash2
November 2019 12
Kelompok Sia.docx
November 2019 14
November 2019 15