12.1. Comparing and Sorting¶
12.1.1. Objectives¶
Upon completion of this module, students will be able to:
Describe concepts of ordering and sorting
Develop methods to compare primitives and Objects
Describe and develop classes which implement the Comparable interface or the Comparator interface
Describe the behavior of various sort methods including: bubble sort, selection sort, and insertion sort
Discuss the relative efficiencies of various sort methods
Implement, test, and use various sort methods and methods which support comparisons
Identify when to use the Comparable interface vs the Comparator interface
12.1.2. Introduction to Ordering, Comparing, and Sorting¶
12.1.2.1. [13:39] Introduction to Sorting and Comparing Video¶
<iframe id=”kaltura_player” src=”https://cdnapisec.kaltura.com/p/2375811/sp/237581100/embedIframeJs/uiconf_id/41950791/partner_id/2375811?iframeembed=true&playerId=kaltura_player&entry_id=1_nhqfykqn&flashvars[streamerType]=auto&flashvars[localizationCode]=en&flashvars[leadWithHTML5]=true&flashvars[sideBarContainer.plugin]=true&flashvars[sideBarContainer.position]=left&flashvars[sideBarContainer.clickToClose]=true&flashvars[chapters.plugin]=true&flashvars[chapters.layout]=vertical&flashvars[chapters.thumbnailRotator]=false&flashvars[streamSelector.plugin]=true&flashvars[EmbedPlayer.SpinnerTarget]=videoHolder&flashvars[dualScreen.plugin]=true&flashvars[Kaltura.addCrossoriginToIframe]=true&&wid=1_8a0l8cln” width=”560” height=”630” allowfullscreen webkitallowfullscreen mozAllowFullScreen allow=”autoplay *; fullscreen *; encrypted-media *” sandbox=”allow-forms allow-same-origin allow-scripts allow-top-navigation allow-pointer-lock allow-popups allow-modals allow-orientation-lock allow-popups-to-escape-sandbox allow-presentation allow-top-navigation-by-user-activation” frameborder=”0” title=”Kaltura Player”></iframe>
TODO: fix URLS.
12.1.2.2. Checkpoint 1¶
12.1.3. Introduction to Sorting Video¶
12.1.3.1. [12:51] Introduction to Sorting Video¶
<iframe id=”kaltura_player” src=”https://cdnapisec.kaltura.com/p/2375811/sp/237581100/embedIframeJs/uiconf_id/41950791/partner_id/2375811?iframeembed=true&playerId=kaltura_player&entry_id=1_px7gfy13&flashvars[streamerType]=auto&flashvars[localizationCode]=en&flashvars[leadWithHTML5]=true&flashvars[sideBarContainer.plugin]=true&flashvars[sideBarContainer.position]=left&flashvars[sideBarContainer.clickToClose]=true&flashvars[chapters.plugin]=true&flashvars[chapters.layout]=vertical&flashvars[chapters.thumbnailRotator]=false&flashvars[streamSelector.plugin]=true&flashvars[EmbedPlayer.SpinnerTarget]=videoHolder&flashvars[dualScreen.plugin]=true&flashvars[Kaltura.addCrossoriginToIframe]=true&&wid=1_285njtlp” width=”560” height=”630” allowfullscreen webkitallowfullscreen mozAllowFullScreen allow=”autoplay *; fullscreen *; encrypted-media *” sandbox=”allow-forms allow-same-origin allow-scripts allow-top-navigation allow-pointer-lock allow-popups allow-modals allow-orientation-lock allow-popups-to-escape-sandbox allow-presentation allow-top-navigation-by-user-activation” frameborder=”0” title=”Kaltura Player”></iframe>
TODO: fix URLS.
12.1.3.2. Checkpoint 2¶
12.1.4. Selection Sort Video¶
12.1.4.1. [12:36] Selection Sort Video¶
<iframe id=”kaltura_player” src=”https://cdnapisec.kaltura.com/p/2375811/sp/237581100/embedIframeJs/uiconf_id/41950791/partner_id/2375811?iframeembed=true&playerId=kaltura_player&entry_id=1_cs0nki5i&flashvars[streamerType]=auto&flashvars[localizationCode]=en&flashvars[leadWithHTML5]=true&flashvars[sideBarContainer.plugin]=true&flashvars[sideBarContainer.position]=left&flashvars[sideBarContainer.clickToClose]=true&flashvars[chapters.plugin]=true&flashvars[chapters.layout]=vertical&flashvars[chapters.thumbnailRotator]=false&flashvars[streamSelector.plugin]=true&flashvars[EmbedPlayer.SpinnerTarget]=videoHolder&flashvars[dualScreen.plugin]=true&flashvars[Kaltura.addCrossoriginToIframe]=true&&wid=1_df2mgnj1” width=”560” height=”630” allowfullscreen webkitallowfullscreen mozAllowFullScreen allow=”autoplay *; fullscreen *; encrypted-media *” sandbox=”allow-forms allow-same-origin allow-scripts allow-top-navigation allow-pointer-lock allow-popups allow-modals allow-orientation-lock allow-popups-to-escape-sandbox allow-presentation allow-top-navigation-by-user-activation” frameborder=”0” title=”Kaltura Player”></iframe>
TODO: fix URLS.
12.1.4.2. Checkpoint 3¶
12.1.5. Insertion Sort¶
12.1.5.1. [16:17] Insertion Sort Array Video¶
<iframe id=”kaltura_player” src=”https://cdnapisec.kaltura.com/p/2375811/sp/237581100/embedIframeJs/uiconf_id/41950791/partner_id/2375811?iframeembed=true&playerId=kaltura_player&entry_id=1_19z2exnz&flashvars[streamerType]=auto&flashvars[localizationCode]=en&flashvars[leadWithHTML5]=true&flashvars[sideBarContainer.plugin]=true&flashvars[sideBarContainer.position]=left&flashvars[sideBarContainer.clickToClose]=true&flashvars[chapters.plugin]=true&flashvars[chapters.layout]=vertical&flashvars[chapters.thumbnailRotator]=false&flashvars[streamSelector.plugin]=true&flashvars[EmbedPlayer.SpinnerTarget]=videoHolder&flashvars[dualScreen.plugin]=true&flashvars[Kaltura.addCrossoriginToIframe]=true&&wid=1_nkxarma4” width=”560” height=”630” allowfullscreen webkitallowfullscreen mozAllowFullScreen allow=”autoplay *; fullscreen *; encrypted-media *” sandbox=”allow-forms allow-same-origin allow-scripts allow-top-navigation allow-pointer-lock allow-popups allow-modals allow-orientation-lock allow-popups-to-escape-sandbox allow-presentation allow-top-navigation-by-user-activation” frameborder=”0” title=”Kaltura Player”></iframe>
TODO: fix URLS.
12.1.5.2. Checkpoint 4¶
12.1.6. Insertion Sort Array¶
12.1.6.1. [16:50] Insertion Sort Linked Chain Video¶
<iframe id=”kaltura_player” src=”https://cdnapisec.kaltura.com/p/2375811/sp/237581100/embedIframeJs/uiconf_id/41950791/partner_id/2375811?iframeembed=true&playerId=kaltura_player&entry_id=1_qc2qxx6h&flashvars[streamerType]=auto&flashvars[localizationCode]=en&flashvars[leadWithHTML5]=true&flashvars[sideBarContainer.plugin]=true&flashvars[sideBarContainer.position]=left&flashvars[sideBarContainer.clickToClose]=true&flashvars[chapters.plugin]=true&flashvars[chapters.layout]=vertical&flashvars[chapters.thumbnailRotator]=false&flashvars[streamSelector.plugin]=true&flashvars[EmbedPlayer.SpinnerTarget]=videoHolder&flashvars[dualScreen.plugin]=true&flashvars[Kaltura.addCrossoriginToIframe]=true&&wid=1_wza959a2” width=”560” height=”630” allowfullscreen webkitallowfullscreen mozAllowFullScreen allow=”autoplay *; fullscreen *; encrypted-media *” sandbox=”allow-forms allow-same-origin allow-scripts allow-top-navigation allow-pointer-lock allow-popups allow-modals allow-orientation-lock allow-popups-to-escape-sandbox allow-presentation allow-top-navigation-by-user-activation” frameborder=”0” title=”Kaltura Player”></iframe>
TODO: fix URLS.