CSC375 Homework10 George Corser 2009-04-06

CSC375 Homework10 George Corser 2009-04-06 - CSC 375...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 375 Homework 10 The due date of this homework was April 6, but I submitted it late. George Corser If no credit is given for that reason, I completely understand. 2009 April 6 (Turned in April 11) Please accept my apologies for my tardiness. 9.6 Self-organizing list: A B C D E F G H. Accesses: D H H G H E G H G H C E H G. The three methods below are count, move-to-front and transpose. Count : HGEDCABF; comparisons required = 53. Access Comp’s A count B count C count D count E count F count G count H count New List Original 0 0 0 0 0 0 0 0 0 ABCDEFGH D 4 0 0 0 1 0 0 0 0 D ABCEFGH H 8 0 0 0 1 0 0 0 1 D H ABCEFG H 1 0 0 0 1 0 0 0 2 HDABCEFG G 8 0 0 0 1 0 0 1 2 HD G ABCEF H 1 0 0 0 1 0 0 1 3 HDGABCEF E 7 0 0 0 1 1 0 1 3 HDG E ABCF G 3 0 0 0 1 1 0 2 3 H G DEABCF H 1 0 0 0 1 1 0 2 4 HGDEABCF G 2 0 0 0 1 1 0 3 4 HGDEABCF H 1 0 0 0 1 1 0 3 5 HGDEABCF E 4 0 0 0 1 2 0 3 5 HG E DCABF C 7 0 0 1 1 2 0 3 5 HGEDCABF E 3 0 0 1 1 3 0 3 5 HGEDCABF H 1 0 0 1 1 3 0 3 6 HGEDCABF G 2 0 0 1 1 3 0 3 6 HGEDCABF Total 53 Move-to-front : GHECDABF Transpose : ABDEHGCF comparisons required = 59. comparisons required = 95. Access Comp’s New List Access Comp’s New List Original 0 ABCDEFGH Original 0 ABCDEFGH D 4 DABCEFGH D 4 ABDCEFGH H 8 HDABCEFG H 8 ABDCEFHG H 1 HDABCEFG H 7 ABDCEHFG G 8 GHDABCEF G 8 ABDCEHGF H 2 HGDABCEF H 6 ABDCHEGF E 7 EHGDABCF E 6 ABDCEHGF G 3 GEHDABCF G 7 ABDCEGHF H 3 HGEDABCF H 7 ABDCEHGF G 2 GHEDABCF G 7 ABDCEGHF H 2 HGEDABCF H 7 ABDCEHGF E 3 EHGDABCF E 5 ABDECHGF C 7 CEHGDABF C 5 ABDCEHGF E 2 ECHGDABF E 5 ABDECHGF H 3 HECGDABF H 6 ABDEHCGF G 4 GHECDABF G 7 ABDEHGCF Total 59 Total 95 9.7 1. Count : The series of record accesses that would require the greatest number of comparisons would be one in which the last item in the list is the one whose count is to be incremented. That’s basically accessing the list in
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

CSC375 Homework10 George Corser 2009-04-06 - CSC 375...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online