ÿþ<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=unicode"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 12"> <meta name=Originator content="Microsoft Word 12"> <link rel=File-List href="cmp251march_files/filelist.xml"> <link rel=Preview href="cmp251march_files/preview.wmf"> <link rel=Edit-Time-Data href="cmp251march_files/editdata.mso"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--> <title>Class notes for cmp251</title> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>Sher</o:Author> <o:LastAuthor>David B. Sher</o:LastAuthor> <o:Revision>2</o:Revision> <o:TotalTime>1</o:TotalTime> <o:Created>2009-03-31T22:44:00Z</o:Created> <o:LastSaved>2009-03-31T22:44:00Z</o:LastSaved> <o:Pages>9</o:Pages> <o:Words>831</o:Words> <o:Characters>4739</o:Characters> <o:Company>Nassau Community College</o:Company> <o:Lines>39</o:Lines> <o:Paragraphs>11</o:Paragraphs> <o:CharactersWithSpaces>5559</o:CharactersWithSpaces> <o:Version>12.00</o:Version> </o:DocumentProperties> </xml><![endif]--> <link rel=themeData href="cmp251march_files/themedata.thmx"> <link rel=colorSchemeMapping href="cmp251march_files/colorschememapping.xml"> <!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>BestFit</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:DontVertAlignCellWithSp/> <w:DontBreakConstrainedForcedTables/> <w:DontVertAlignInTxbx/> <w:Word11KerningPairs/> <w:CachedColBalance/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="&#45;-"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true" DefSemiHidden="true" DefQFormat="false" DefPriority="99" LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Normal"/> <w:LsdException Locked="false" Priority="9" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="heading 1"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/> <w:LsdException Locked="false" Priority="39" Name="toc 1"/> <w:LsdException Locked="false" Priority="39" Name="toc 2"/> <w:LsdException Locked="false" Priority="39" Name="toc 3"/> <w:LsdException Locked="false" Priority="39" Name="toc 4"/> <w:LsdException Locked="false" Priority="39" Name="toc 5"/> <w:LsdException Locked="false" Priority="39" Name="toc 6"/> <w:LsdException Locked="false" Priority="39" Name="toc 7"/> <w:LsdException Locked="false" Priority="39" Name="toc 8"/> <w:LsdException Locked="false" Priority="39" Name="toc 9"/> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/> <w:LsdException Locked="false" Priority="10" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Title"/> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="11" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/> <w:LsdException Locked="false" Priority="22" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Strong"/> <w:LsdException Locked="false" Priority="20" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/> <w:LsdException Locked="false" Priority="59" SemiHidden="false" UnhideWhenUsed="false" Name="Table Grid"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/> <w:LsdException Locked="false" Priority="34" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" SemiHidden="false" UnhideWhenUsed="false" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" SemiHidden="false" UnhideWhenUsed="false" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" SemiHidden="false" UnhideWhenUsed="false" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" SemiHidden="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" SemiHidden="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" SemiHidden="false" UnhideWhenUsed="false" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" SemiHidden="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" SemiHidden="false" UnhideWhenUsed="false" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--> <style> <!-- /* Font Definitions */ @font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0; mso-font-charset:2; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-520082689 -1073717157 41 0 66047 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} p {mso-style-priority:99; mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} p.MsoAcetate, li.MsoAcetate, div.MsoAcetate {mso-style-noshow:yes; mso-style-priority:99; mso-style-link:"Balloon Text Char"; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:8.0pt; font-family:"Tahoma","sans-serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} span.BalloonTextChar {mso-style-name:"Balloon Text Char"; mso-style-noshow:yes; mso-style-priority:99; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Balloon Text"; mso-ansi-font-size:8.0pt; mso-bidi-font-size:8.0pt; font-family:"Tahoma","sans-serif"; mso-ascii-font-family:Tahoma; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Tahoma; mso-bidi-font-family:Tahoma;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:439031181; mso-list-template-ids:1719942184;} @list l0:level1 {mso-level-number-format:bullet; mso-level-text:·ð; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} @list l1 {mso-list-id:1122920394; mso-list-template-ids:125055980;} @list l1:level1 {mso-level-number-format:bullet; mso-level-text:·ð; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} @list l2 {mso-list-id:1628899410; mso-list-template-ids:-980137672;} @list l2:level1 {mso-level-number-format:bullet; mso-level-text:·ð; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} @list l3 {mso-list-id:1714382302; mso-list-template-ids:1847602296;} @list l3:level1 lfo4 {mso-level-start-at:4;} @list l3:level1 lfo5 {mso-level-start-at:2;} @list l3:level1 lfo6 {mso-level-start-at:3;} ol {margin-bottom:0in;} ul {margin-bottom:0in;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="2050"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--> </head> <body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'> <div class=Section1> <div style='border-width:100%'> <div> <div style='margin-left:1.5pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:17.0pt; font-family:"Calibri","sans-serif"'>3/5<o:p></o:p></span></p> </div> <div style='margin-left:1.5pt;margin-top:2.75pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>Tuesday, March 03, 2009<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>4:29 PM<o:p></o:p></span></p> </div> <div style='margin-top:4.4pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"; mso-no-proof:yes'><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"/> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"/> <v:f eqn="sum @0 1 0"/> <v:f eqn="sum 0 0 @1"/> <v:f eqn="prod @2 1 2"/> <v:f eqn="prod @3 21600 pixelWidth"/> <v:f eqn="prod @3 21600 pixelHeight"/> <v:f eqn="sum @0 0 1"/> <v:f eqn="prod @6 1 2"/> <v:f eqn="prod @7 21600 pixelWidth"/> <v:f eqn="sum @8 21600 0"/> <v:f eqn="prod @7 21600 pixelHeight"/> <v:f eqn="sum @10 21600 0"/> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/> <o:lock v:ext="edit" aspectratio="t"/> </v:shapetype><v:shape id="Picture_x0020_1" o:spid="_x0000_i1060" type="#_x0000_t75" style='width:578.25pt;height:198.75pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image001.png" o:title="image001"/> </v:shape><![endif]--><![if !vml]><img width=771 height=265 src="cmp251march_files/image002.gif" v:shapes="Picture_x0020_1"><![endif]></span><span style='mso-fareast-font-family:"Times New Roman"'><o:p></o:p></span></p> </div> <div style='margin-top:52.9pt'><nobr> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"; mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_2" o:spid="_x0000_i1059" type="#_x0000_t75" style='width:456.75pt;height:10in;visibility:visible; mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image003.png" o:title="image002"/> </v:shape><![endif]--><![if !vml]><img width=609 height=960 src="cmp251march_files/image004.gif" v:shapes="Picture_x0020_2"><![endif]></span><span style='mso-fareast-font-family:"Times New Roman"'><br> <span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_3" o:spid="_x0000_i1058" type="#_x0000_t75" style='width:456.75pt;height:10in; visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image005.png" o:title="image003"/> </v:shape><![endif]--><![if !vml]><img width=609 height=960 src="cmp251march_files/image006.gif" v:shapes="Picture_x0020_3"><![endif]></span><br> <span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_4" o:spid="_x0000_i1057" type="#_x0000_t75" style='width:456.75pt;height:468pt; visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image007.png" o:title="image004"/> </v:shape><![endif]--><![if !vml]><img width=609 height=624 src="cmp251march_files/image008.gif" v:shapes="Picture_x0020_4"><![endif]></span><br style='mso-special-character:line-break'> <![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'> <![endif]><o:p></o:p></span></p> </div> </nobr> <div style='margin-left:1.5pt;margin-top:34.9pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Hw<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Which is faster<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>(1000+n^ln(n)+n^10) or 5+ln(n)^n+sqrt(n)<o:p></o:p></span></p> </div> </div> </div> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <div style='border-width:100%'> <div> <div style='margin-left:5.4pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:17.0pt; font-family:"Calibri","sans-serif"'>3/10<o:p></o:p></span></p> </div> <div style='margin-left:5.4pt;margin-top:2.75pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>Tuesday, March 10, 2009<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>4:04 PM<o:p></o:p></span></p> </div> <div style='margin-left:3.8pt;margin-top:20.9pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_5" o:spid="_x0000_i1056" type="#_x0000_t75" style='width:116.25pt; height:30.75pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image009.gif" o:title="image005"/> </v:shape><![endif]--><![if !vml]><img width=155 height=41 src="cmp251march_files/image009.gif" v:shapes="Picture_x0020_5"><![endif]></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_6" o:spid="_x0000_i1055" type="#_x0000_t75" style='width:318.75pt; height:41.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image010.gif" o:title="image006"/> </v:shape><![endif]--><![if !vml]><img width=425 height=55 src="cmp251march_files/image010.gif" v:shapes="Picture_x0020_6"><![endif]></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_7" o:spid="_x0000_i1054" type="#_x0000_t75" style='width:254.25pt; height:37.5pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image011.gif" o:title="image007"/> </v:shape><![endif]--><![if !vml]><img width=339 height=50 src="cmp251march_files/image011.gif" v:shapes="Picture_x0020_7"><![endif]></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </div> <div style='margin-top:30.1pt'> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Insert sort is O(n^2) <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Sort<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>1,2,3,4,5,6,7,8 & n<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>0+1+2+3+4+5+& +n-1 = <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_8" o:spid="_x0000_i1053" type="#_x0000_t75" style='width:138pt; height:27.75pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image012.gif" o:title="image008"/> </v:shape><![endif]--><![if !vml]><img width=184 height=37 src="cmp251march_files/image012.gif" v:shapes="Picture_x0020_8"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Worst case<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Best case is O(n)<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>n,n-1,n-2,& 3,2,1<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Two major categories of sorts O(n^2) or O(nlog(n))<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_9" o:spid="_x0000_i1052" type="#_x0000_t75" style='width:99.75pt; height:15pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image013.gif" o:title="image009"/> </v:shape><![endif]--><![if !vml]><img width=133 height=20 src="cmp251march_files/image013.gif" v:shapes="Picture_x0020_9"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Ignore log bases.<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>O(n^2) sorts: insert, select, bubble,shell, quick (worst case),tree(worst case)<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>O(nlog(n)) sorts: merge, heap, quick (average case), tree (average case)<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Size 16<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>16^2=256 16log2(16)=64<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>2^20 = 1,048,576 <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Size 2^20<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>2^20*2^20 = 1E12 <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>2^20*20 = 20,971,520 <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>2^20/20 = 52,428.8 <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Size 2^30<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>2^30/30 = 3.5791E7 <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Average of insert sort<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Assume random order<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_10" o:spid="_x0000_i1051" type="#_x0000_t75" style='width:240pt; height:44.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image014.gif" o:title="image010"/> </v:shape><![endif]--><![if !vml]><img width=320 height=59 src="cmp251march_files/image014.gif" v:shapes="Picture_x0020_10"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_11" o:spid="_x0000_i1050" type="#_x0000_t75" style='width:264.75pt; height:38.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image015.gif" o:title="image011"/> </v:shape><![endif]--><![if !vml]><img width=353 height=51 src="cmp251march_files/image015.gif" v:shapes="Picture_x0020_11"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_12" o:spid="_x0000_i1049" type="#_x0000_t75" style='width:315pt; height:38.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image016.gif" o:title="image012"/> </v:shape><![endif]--><![if !vml]><img width=420 height=51 src="cmp251march_files/image016.gif" v:shapes="Picture_x0020_12"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_13" o:spid="_x0000_i1048" type="#_x0000_t75" style='width:228pt; height:60pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image017.gif" o:title="image013"/> </v:shape><![endif]--><![if !vml]><img width=304 height=80 src="cmp251march_files/image017.gif" v:shapes="Picture_x0020_13"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:140.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_14" o:spid="_x0000_i1047" type="#_x0000_t75" style='width:143.25pt; height:28.5pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image018.gif" o:title="image014"/> </v:shape><![endif]--><![if !vml]><img width=191 height=38 src="cmp251march_files/image018.gif" v:shapes="Picture_x0020_14"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:140.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:167.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_15" o:spid="_x0000_i1046" type="#_x0000_t75" style='width:37.5pt; height:27.75pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image019.gif" o:title="image015"/> </v:shape><![endif]--><![if !vml]><img width=50 height=37 src="cmp251march_files/image019.gif" v:shapes="Picture_x0020_15"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:167.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:32.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_16" o:spid="_x0000_i1045" type="#_x0000_t75" style='width:72.75pt; height:71.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image020.gif" o:title="image016"/> </v:shape><![endif]--><![if !vml]><img width=97 height=95 src="cmp251march_files/image020.gif" v:shapes="Picture_x0020_16"><![endif]></span></p> <div> <table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 style='margin-left:29.35pt;border-collapse:collapse;border:none;mso-border-alt: solid #A3A3A3 .25pt;mso-yfti-tbllook:1184;mso-padding-alt:0in 0in 0in 0in'> <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes'> <td width=207 valign=top style='width:155.1pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_17" o:spid="_x0000_i1044" type="#_x0000_t75" style='width:140.25pt; height:1in;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image021.gif" o:title="image017"/> </v:shape><![endif]--><![if !vml]><img width=187 height=96 src="cmp251march_files/image021.gif" v:shapes="Picture_x0020_17"><![endif]></span></p> </td> </tr> </table> </div> <table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 style='margin-left:29.35pt;border-collapse:collapse;border:none;mso-border-alt: solid #A3A3A3 .25pt;mso-yfti-tbllook:1184;mso-padding-alt:0in 0in 0in 0in'> <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;mso-yfti-lastrow:yes'> <td width=102 valign=top style='width:76.3pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_18" o:spid="_x0000_i1043" type="#_x0000_t75" style='width:60.75pt; height:35.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image022.gif" o:title="image018"/> </v:shape><![endif]--><![if !vml]><img width=81 height=47 src="cmp251march_files/image022.gif" v:shapes="Picture_x0020_18"><![endif]></span></p> </td> </tr> </table> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:59.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_19" o:spid="_x0000_i1042" type="#_x0000_t75" style='width:51pt; height:30.75pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image023.gif" o:title="image019"/> </v:shape><![endif]--><![if !vml]><img width=68 height=41 src="cmp251march_files/image023.gif" v:shapes="Picture_x0020_19"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:59.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_20" o:spid="_x0000_i1041" type="#_x0000_t75" style='width:493.5pt; height:279.75pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image024.jpg" o:title="image020"/> </v:shape><![endif]--><![if !vml]><img width=658 height=373 src="cmp251march_files/image024.jpg" v:shapes="Picture_x0020_20"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <div> <table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 style='margin-left:5.35pt;border-collapse:collapse;border:none;mso-border-alt: solid #A3A3A3 .25pt;mso-yfti-tbllook:1184;mso-padding-alt:0in 0in 0in 0in'> <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'> <td width=64 valign=top style='width:48.0pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> <td width=382 valign=top style='width:286.5pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> <td width=69 valign=top style='width:51.55pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:1'> <td width=64 valign=top style='width:48.0pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> <td width=382 valign=top style='width:286.5pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_21" o:spid="_x0000_i1040" type="#_x0000_t75" style='width:80.25pt; height:38.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image025.gif" o:title="image021"/> </v:shape><![endif]--><![if !vml]><img width=107 height=51 src="cmp251march_files/image025.gif" v:shapes="Picture_x0020_21"><![endif]></span></p> </td> <td width=69 valign=top style='width:51.55pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:2'> <td width=64 valign=top style='width:48.0pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> <td width=382 valign=top style='width:286.5pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> <td width=69 valign=top style='width:51.55pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:3;mso-yfti-lastrow:yes'> <td width=64 valign=top style='width:48.0pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> <td width=382 valign=top style='width:286.5pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_22" o:spid="_x0000_i1039" type="#_x0000_t75" style='width:274.5pt; height:80.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image026.gif" o:title="image022"/> </v:shape><![endif]--><![if !vml]><img width=366 height=107 src="cmp251march_files/image026.gif" v:shapes="Picture_x0020_22"><![endif]></span></p> </td> <td width=69 valign=top style='width:51.55pt;border:none;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> </tr> </table> </div> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'>&nbsp;</p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:8.0pt;font-family:"Tahoma","sans-serif"; color:#666666'>Pasted from &lt;<a href="file:///J:\My%20Documents\Proof%20Without%20Words.docx">file:///J:\My%20Documents\Proof%20Without%20Words.docx</a>&gt; <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_23" o:spid="_x0000_i1038" type="#_x0000_t75" style='width:102.75pt; height:29.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image027.png" o:title="image023"/> </v:shape><![endif]--><![if !vml]><img border=0 width=137 height=39 src="cmp251march_files/image028.gif" v:shapes="Picture_x0020_23"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_24" o:spid="_x0000_i1037" type="#_x0000_t75" style='width:106.5pt; height:29.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image029.png" o:title="image024"/> </v:shape><![endif]--><![if !vml]><img border=0 width=142 height=39 src="cmp251march_files/image030.gif" v:shapes="Picture_x0020_24"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_25" o:spid="_x0000_i1036" type="#_x0000_t75" style='width:87pt; height:29.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image031.png" o:title="image025"/> </v:shape><![endif]--><![if !vml]><img border=0 width=116 height=39 src="cmp251march_files/image032.gif" v:shapes="Picture_x0020_25"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_26" o:spid="_x0000_i1035" type="#_x0000_t75" style='width:75.75pt; height:29.25pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image033.png" o:title="image026"/> </v:shape><![endif]--><![if !vml]><img border=0 width=101 height=39 src="cmp251march_files/image034.gif" v:shapes="Picture_x0020_26"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Log(100000000) = 18.42068074395237 <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>25000000/60/60/24 = 289.3519 days<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>1842/60 = 30.7 minutes<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </div> </div> </div> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <div style='border-width:100%'> <div> <div> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:17.0pt; font-family:"Calibri","sans-serif"'>3/12<o:p></o:p></span></p> </div> <div style='margin-top:2.75pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>Thursday, March 12, 2009<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>5:02 PM<o:p></o:p></span></p> </div> <div style='margin-top:22.4pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Merge sort<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>(??) (??) (??) (??) (??) (??) (??) (??)<span style='mso-spacerun:yes'>   </span>8 comparisons<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>(????) (????) (????) (????)<span style='mso-spacerun:yes'>            </span>8 &lt;= comparisons &lt;= 12 <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>(????????) (????????)<span style='mso-spacerun:yes'>                   </span>&lt;= 14 comparison<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>(????????????????)<span style='mso-spacerun:yes'>                       </span>&lt;= 15 comparisons<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Sorting 16 elements takes between 32<span style='mso-spacerun:yes'>  </span>&amp; 49 comparisons inclusive<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Merge Sort (size n) is in O(nlog(n))<o:p></o:p></span></p> </div> <div style='margin-top:40.55pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Hash Tables<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>0-&gt;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>1-&gt;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>2-&gt;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>& <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>T-1-&gt;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Each entry has a key that we search for (for example N number)<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Hashing translates key to a number from 0 to T-1<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </div> </div> </div> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <div style='border-width:100%'> <div> <div> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:17.0pt; font-family:"Calibri","sans-serif"'>3/17<o:p></o:p></span></p> </div> <div style='margin-top:2.75pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>Tuesday, March 17, 2009<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>4:07 PM<o:p></o:p></span></p> </div> <div style='margin-top:22.4pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Secrets of counting:<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>You need to count the actual comparisons<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Count before the comparison<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>After it might return<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Compare with an if statement so you can count it<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Compare simply<o:p></o:p></span></p> </div> <div style='margin-top:44.55pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>c o m p u t e r<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>m p u t e r co<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>u t e r co mp<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>e r co mp tu<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>co mp tu er<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>tu er cmop<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>cmop ertu<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>cemoprtu<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </div> <div style='margin-top:22.3pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Speed of a merge is between the size of the smaller list<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Sum of both list sizes -1<o:p></o:p></span></p> </div> <div style='margin-top:44.3pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Hash tables<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Only chained <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Collision is when two items hash to the same location in array<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Chained solves this by putting both in linked list<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>When searching <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Go to location, search linked list<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>When linked lists stay small O(1) or less<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>If linked lists get too big we can double size of table and rehash<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>How much work is rehashing:<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Start with n items <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>1111111<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>1111111<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>22222222222222<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>4444444444444444444444444<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>n(1+1+2+4+8+& 2^k)= n(2^(k+1)) to insert n(2^k) items<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>O(1)<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>For proj 3 fixed size hash table (flexible in addition could be extra credit)<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'><br> Hash function properties<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Hash function takes a key and computes a location in the array<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Always same no time factor<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Only key data<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Evenly distributed<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Easily computed<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Positive Integer<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Insert(data) <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:27.0pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>contents[hash(data.key())%contents.length].insert(data)<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Find(key)<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:27.0pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>contents[hash(key)%contents.length].find(key)<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'><span style='mso-spacerun:yes'> </span><o:p></o:p></span></p> </div> </div> </div> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <div style='border-width:100%'> <div> <div style='margin-left:5.4pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:17.0pt; font-family:"Calibri","sans-serif"'>3/19<o:p></o:p></span></p> </div> <div style='margin-left:5.4pt;margin-top:2.75pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>Thursday, March 19, 2009<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>4:01 PM<o:p></o:p></span></p> </div> <div style='margin-top:22.4pt'> <div> <table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none;mso-border-alt:solid #A3A3A3 1.0pt; mso-yfti-tbllook:1184;mso-padding-alt:0in 0in 0in 0in'> <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'> <td width=64 valign=top style='width:48.0pt;border:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>0<o:p></o:p></span></p> </td> <td width=72 valign=top style='width:53.85pt;border:solid #A3A3A3 1.0pt; border-left:none;mso-border-left-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>dhlptx<o:p></o:p></span></p> </td> <td width=69 valign=top style='width:51.55pt;border:solid #A3A3A3 1.0pt; border-left:none;mso-border-left-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>tp<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:1'> <td width=64 valign=top style='width:48.0pt;border:solid #A3A3A3 1.0pt; border-top:none;mso-border-top-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>1<o:p></o:p></span></p> </td> <td width=72 valign=top style='width:53.85pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>aeimquy<o:p></o:p></span></p> </td> <td width=69 valign=top style='width:51.55pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>eum<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:2'> <td width=64 valign=top style='width:48.0pt;border:solid #A3A3A3 1.0pt; border-top:none;mso-border-top-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>2<o:p></o:p></span></p> </td> <td width=72 valign=top style='width:53.85pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>bfjnrvz<o:p></o:p></span></p> </td> <td width=69 valign=top style='width:51.55pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>r<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:3;mso-yfti-lastrow:yes'> <td width=64 valign=top style='width:48.0pt;border:solid #A3A3A3 1.0pt; border-top:none;mso-border-top-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>3<o:p></o:p></span></p> </td> <td width=72 valign=top style='width:53.85pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>cgkosw<o:p></o:p></span></p> </td> <td width=69 valign=top style='width:51.55pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>oc<o:p></o:p></span></p> </td> </tr> </table> </div> </div> <div style='margin-left:23.4pt;margin-top:30.75pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"; mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_27" o:spid="_x0000_i1034" type="#_x0000_t75" style='width:397.5pt;height:175.5pt;visibility:visible; mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image035.png" o:title="image027"/> </v:shape><![endif]--><![if !vml]><img border=0 width=530 height=234 src="cmp251march_files/image036.gif" v:shapes="Picture_x0020_27"><![endif]></span><span style='mso-fareast-font-family:"Times New Roman"'><o:p></o:p></span></p> </div> <div style='margin-left:9.0pt;margin-top:10.65pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"; mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_28" o:spid="_x0000_i1033" type="#_x0000_t75" style='width:546pt;height:669pt;visibility:visible; mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image037.png" o:title="image028"/> </v:shape><![endif]--><![if !vml]><img border=0 width=728 height=892 src="cmp251march_files/image038.gif" v:shapes="Picture_x0020_28"><![endif]></span><span style='mso-fareast-font-family:"Times New Roman"'><o:p></o:p></span></p> </div> <div style='margin-left:3.8pt;margin-top:10.65pt'> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Hashing n items<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>The probability of index k will be t(k)<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Average length of the list at index k will be n*t(k)<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Success rate will be p<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_29" o:spid="_x0000_i1032" type="#_x0000_t75" style='width:159pt; height:22.5pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image039.gif" o:title="image029"/> </v:shape><![endif]--><![if !vml]><img border=0 width=212 height=30 src="cmp251march_files/image039.gif" v:shapes="Picture_x0020_29"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>)<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_30" o:spid="_x0000_i1031" type="#_x0000_t75" style='width:58.5pt; height:39.75pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image040.gif" o:title="image030"/> </v:shape><![endif]--><![if !vml]><img border=0 width=78 height=53 src="cmp251march_files/image040.gif" v:shapes="Picture_x0020_30"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_31" o:spid="_x0000_i1030" type="#_x0000_t75" style='width:380.25pt; height:39.75pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image041.gif" o:title="image031"/> </v:shape><![endif]--><![if !vml]><img border=0 width=507 height=53 src="cmp251march_files/image041.gif" v:shapes="Picture_x0020_31"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_32" o:spid="_x0000_i1029" type="#_x0000_t75" style='width:383.25pt; height:39.75pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image042.gif" o:title="image032"/> </v:shape><![endif]--><![if !vml]><img border=0 width=511 height=53 src="cmp251march_files/image042.gif" v:shapes="Picture_x0020_32"><![endif]></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:1.45pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </div> </div> </div> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <div style='border-width:100%'> <div> <div style='margin-left:5.4pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:17.0pt; font-family:"Calibri","sans-serif"'>3/24<o:p></o:p></span></p> </div> <div style='margin-left:5.4pt;margin-top:2.75pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>Tuesday, March 24, 2009<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>4:05 PM<o:p></o:p></span></p> </div> <div style='margin-top:22.4pt'> <div> <table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none;mso-border-alt:solid #A3A3A3 1.0pt; mso-yfti-tbllook:1184;mso-padding-alt:0in 0in 0in 0in'> <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'> <td width=69 valign=top style='width:51.75pt;border:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>0ejoty<o:p></o:p></span></p> </td> <td width=64 valign=top style='width:48.0pt;border:solid #A3A3A3 1.0pt; border-left:none;mso-border-left-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>et<o:p></o:p></span></p> </td> <td width=269 valign=top style='width:201.45pt;border:solid #A3A3A3 1.0pt; border-left:none;mso-border-left-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>(5/26)*((2/5)*(2+1)/2+(3/5)*2) = 0.3462 <o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:1'> <td width=69 valign=top style='width:51.75pt;border:solid #A3A3A3 1.0pt; border-top:none;mso-border-top-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>1afkpuz<o:p></o:p></span></p> </td> <td width=64 valign=top style='width:48.0pt;border-top:none;border-left:none; border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>a<o:p></o:p></span></p> </td> <td width=269 valign=top style='width:201.45pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>6/26 = 0.2308<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:2'> <td width=69 valign=top style='width:51.75pt;border:solid #A3A3A3 1.0pt; border-top:none;mso-border-top-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>2bglqv<o:p></o:p></span></p> </td> <td width=64 valign=top style='width:48.0pt;border-top:none;border-left:none; border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> <td width=269 valign=top style='width:201.45pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>0<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:3'> <td width=69 valign=top style='width:51.75pt;border:solid #A3A3A3 1.0pt; border-top:none;mso-border-top-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>3chmrw<o:p></o:p></span></p> </td> <td width=64 valign=top style='width:48.0pt;border-top:none;border-left:none; border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>rhc<o:p></o:p></span></p> </td> <td width=269 valign=top style='width:201.45pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>(5/26)*((3/5)*(3+1)/2+(2/5)*3) = 0.4615 <o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:4;mso-yfti-lastrow:yes'> <td width=69 valign=top style='width:51.75pt;border:solid #A3A3A3 1.0pt; border-top:none;mso-border-top-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>4dinsx<o:p></o:p></span></p> </td> <td width=64 valign=top style='width:48.0pt;border-top:none;border-left:none; border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </td> <td width=269 valign=top style='width:201.45pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>0<o:p></o:p></span></p> </td> </tr> </table> </div> </div> <div style='margin-left:.25in;margin-top:30.4pt'> <p class=MsoNormal style='margin-left:23.25pt;text-indent:-.25in;mso-list:l3 level1 lfo4; tab-stops:list .5in;vertical-align:middle'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri'><span style='mso-list:Ignore'>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp; </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family: "Times New Roman"'>0.3462 +0.2308+0.4615 = 1.0385 <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:23.25pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>8/26+2*5/26+3*3/26 = 1.0385 <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:23.25pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:23.25pt;text-indent:-.25in;mso-list:l3 level1 lfo5; tab-stops:list .5in;vertical-align:middle'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri'><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp; </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family: "Times New Roman"'>3<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:23.25pt;text-indent:-.25in;mso-list:l3 level1 lfo6; tab-stops:list .5in;vertical-align:middle'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family: Calibri;mso-bidi-font-family:Calibri'><span style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp; </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";mso-fareast-font-family: "Times New Roman"'>0<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:23.25pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </div> <div style='margin-left:.25in;margin-top:44.5pt'> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Priority queues<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Differ from regular queues in one respect:<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Dequeue always returns highest priority item<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Every item has a Comparable priority<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Every priority queue is a sorting algorithm<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Enqueue every item in the list <o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Dequeue every item in the list<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>The items will be sorted by priority<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Every sorting algorithm is a priority queue<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Enqueue - add parameter to end of list, sort highest to lowest priority<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>Dequeue - remove and return first item of list<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:5.35pt; margin-bottom:.0001pt'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <div> <table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 style='margin-left:5.35pt;border-collapse:collapse;border:none;mso-border-alt: solid #A3A3A3 1.0pt;mso-yfti-tbllook:1184;mso-padding-alt:0in 0in 0in 0in'> <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'> <td width=80 valign=top style='width:60.35pt;border:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Algorithm<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:51.05pt;border:solid #A3A3A3 1.0pt; border-left:none;mso-border-left-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Enq<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:51.05pt;border:solid #A3A3A3 1.0pt; border-left:none;mso-border-left-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Deq<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:50.9pt;border:solid #A3A3A3 1.0pt; border-left:none;mso-border-left-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Front<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:1'> <td width=80 valign=top style='width:60.35pt;border:solid #A3A3A3 1.0pt; border-top:none;mso-border-top-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Insert<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:51.05pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>O(n)<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:51.05pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>O(1)<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:50.9pt;border-top:none;border-left:none; border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>O(1)<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:2'> <td width=80 valign=top style='width:60.35pt;border:solid #A3A3A3 1.0pt; border-top:none;mso-border-top-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Select<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:51.05pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>O(1)<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:51.05pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>O(n)<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:50.9pt;border-top:none;border-left:none; border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>O(n)<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:3;mso-yfti-lastrow:yes'> <td width=80 valign=top style='width:60.35pt;border:solid #A3A3A3 1.0pt; border-top:none;mso-border-top-alt:solid #A3A3A3 1.0pt;padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Heap<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:51.05pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>O(log n)<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:51.05pt;border-top:none;border-left: none;border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>O(log n)<o:p></o:p></span></p> </td> <td width=68 valign=top style='width:50.9pt;border-top:none;border-left:none; border-bottom:solid #A3A3A3 1.0pt;border-right:solid #A3A3A3 1.0pt; mso-border-top-alt:solid #A3A3A3 1.0pt;mso-border-left-alt:solid #A3A3A3 1.0pt; padding:1.95pt 3.0pt 1.95pt 3.0pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>O(1)<o:p></o:p></span></p> </td> </tr> </table> </div> </div> <div style='margin-left:3.1pt;margin-top:11.65pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"; mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_33" o:spid="_x0000_i1028" type="#_x0000_t75" style='width:381.75pt;height:291.75pt;visibility:visible; mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image043.png" o:title="image033"/> </v:shape><![endif]--><![if !vml]><img border=0 width=509 height=389 src="cmp251march_files/image044.gif" v:shapes="Picture_x0020_33"><![endif]></span><span style='mso-fareast-font-family:"Times New Roman"'><o:p></o:p></span></p> </div> </div> </div> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <div style='border-width:100%'> <div> <div> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:17.0pt; font-family:"Calibri","sans-serif"'>3/26<o:p></o:p></span></p> </div> <div style='margin-top:2.75pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>Thursday, March 26, 2009<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>4:01 PM<o:p></o:p></span></p> </div> <div style='margin-top:22.4pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"; mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_34" o:spid="_x0000_i1027" type="#_x0000_t75" style='width:420pt;height:162pt;visibility:visible; mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image045.png" o:title="image034"/> </v:shape><![endif]--><![if !vml]><img border=0 width=560 height=216 src="cmp251march_files/image046.gif" v:shapes="Picture_x0020_34"><![endif]></span><span style='mso-fareast-font-family:"Times New Roman"'><o:p></o:p></span></p> </div> <div style='margin-top:18.05pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Implemented with an array<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Root has index 0<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Parent(index) = (index-1)/2;<span style='mso-spacerun:yes'>  </span>(with integer arithmetic).<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Left(index) = 2*index+1<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Right(index) = 2*index+2<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>635124 <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Same quiz with the array<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>7<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>7 5<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>11 5 7<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>11 5 7 3<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>11 6 7 3 5<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>20 6 11 3 5 7<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>20 6 15 3 5 7 11<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>15 6 11 3 5 7 <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>11 6 7 3 5<span style='mso-spacerun:yes'>  </span><o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>7 6 5 3 <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>6 3 5<span style='mso-spacerun:yes'>    </span><o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Heap Sort <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Enqueue every item into a heap<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>When we dequeue we switch root with last item <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>And the root stays there<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>1 2 3 4 5 <o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Put into heap<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>1<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>2 1<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>3 1 2<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>4 3 2 1<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>5 4 2 1 3<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Each time we dequeue we switch and leave it there<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>3 4 2 1 : 5 -&gt; 4 3 2 1 : 5 (5 is no longer in tree just in array)<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>3 1 2<span style='mso-spacerun:yes'>  </span>: 4 5<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>2 1 : 3 4 5<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>1 2 3 4 5<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>10 16 35<span style='mso-spacerun:yes'>  </span>6 5 800 42 714<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>10<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>16 10<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>35 10 16<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>35 10 16 6<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>35 10 16 6 5<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>800 10 35 6 5 16<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>800 10 42 6 5 16 35<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>800 714 42 10 5 16 35 6<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'><span style='mso-spacerun:yes'> </span>714 10 42 6 5 16 35 : 800<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>42 10 35 6 5 16 : 714 800<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>35 10 16 6 5 : 42 714 800<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>16 10 5 6 : 35 42 714 800<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>10 6 5 : 16 35 42 714 800<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>6 5 : 10 16 35 42 714 800<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>5 6 10 16 35 42 714 800 ( everything right of the : is sorted; everything left is in the queue )<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Parent &gt;= its children<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Sw(n) = Sum k/2^k (k = 1 to log2(n-1)) average number of switches in an enqueue<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Sw(2n-1)-2*Sw(n) = Sum k/2^k (k=1 to 1+log2(n-1))- Sum k/2^(k-1) (k=1 to log2(n-1))<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>J = k-1<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>Sum k/2^k (k=1 to 1+log2(n-1))- Sum (j+1)/2^(j) (j=2 to 1+log2(n-1))<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>1/2 - Sum 1/2^j (j = 2 to 1+log2(n-1) approximately 1/4<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </div> </div> </div> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <div style='border-width:100%'> <div> <div style='margin-left:.05in'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:17.0pt; font-family:"Calibri","sans-serif"'>3/31<o:p></o:p></span></p> </div> <div style='margin-left:.05in;margin-top:2.75pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>Tuesday, March 31, 2009<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:10.0pt; font-family:"Calibri","sans-serif";color:gray'>3:58 PM<o:p></o:p></span></p> </div> <div style='margin-left:.05in;margin-top:2.65pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"; mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_35" o:spid="_x0000_i1026" type="#_x0000_t75" style='width:293.25pt;height:262.5pt;visibility:visible; mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image047.png" o:title="image035"/> </v:shape><![endif]--><![if !vml]><img border=0 width=391 height=350 src="cmp251march_files/image048.gif" v:shapes="Picture_x0020_35"><![endif]></span><span style='mso-fareast-font-family:"Times New Roman"'><o:p></o:p></span></p> </div> <div style='margin-left:.05in;margin-top:27.45pt'> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>If two equal children larger, switch with the right one (tree is shallower that way).<o:p></o:p></span></p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:11.0pt; font-family:"Calibri","sans-serif"'>&nbsp;<o:p></o:p></span></p> </div> <div style='margin-top:26.3pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"; mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_36" o:spid="_x0000_i1025" type="#_x0000_t75" style='width:331.5pt;height:296.25pt;visibility:visible; mso-wrap-style:square'> <v:imagedata src="cmp251march_files/image049.png" o:title="image036"/> </v:shape><![endif]--><![if !vml]><img border=0 width=442 height=395 src="cmp251march_files/image050.gif" v:shapes="Picture_x0020_36"><![endif]></span><span style='mso-fareast-font-family:"Times New Roman"'><o:p></o:p></span></p> </div> </div> </div> <div> <p style='margin:0in;margin-bottom:.0001pt'>&nbsp;</p> <p style='margin:0in;margin-bottom:.0001pt'><span style='font-size:9.0pt; font-family:"Arial","sans-serif";color:#969696'>Created with Microsoft Office OneNote 2007<br> One place for all your notes and information<o:p></o:p></span></p> </div> </div> </body> </html>