1
{"words":[["0","[MUSIC PLAYING]"],["471",""],["942",""],["1413",""],["1884",""],["2355",""],["2826",""],["3297",""],["3768",""],["4239",""],["4710",""],["5181",""],["5660","DOUG LLOYD: So"],["5820","insertion"],["5900",""],["6190","sort"],["6380","is"],["6460","another"],["6770","algorithm"],["7100","we"],["7180","can"],["7300","use"],["7520","to"],["7620","sort"],["7960","an"],["8039","array."],["8470",""],["8920",""],["9370","The"],["9500","idea"],["9770","behind"],["10050","this"],["10180","algorithm"],["10380",""],["10570","is"],["10730","to"],["10840","build"],["11095",""],["11350","your"],["11520","sorted"],["11820",""],["11890","array"],["12350","in"],["12620","place,"],["13015",""],["13410",""],["13660","shifting"],["13980",""],["14300","elements"],["14730","out of"],["14960","the"],["15050","way"],["15500","as"],["15780","you"],["15870","go,"],["16140",""],["16410",""],["16830",""],["17250",""],["17380",""],["17685",""],["17990","to"],["18220","make"],["18450","room."],["18880",""],["19275",""],["19670","This is"],["19770","slightly"],["20120","different"],["20430","from"],["20800","selection"],["21270","sort"],["21630","or"],["21890","bubble"],["22240","sort,"],["22450","for"],["22540","example,"],["22950","where"],["23110","we're"],["23450",""],["23870",""],["24290","adjusting"],["24570",""],["24850","the"],["24960","locations,"],["25460","where we're"],["25640","making"],["25930","swaps."],["26255",""],["26580",""],["26910","In"],["27030","this"],["27190","case"],["27400","what we're"],["27590","actually"],["27840","doing"],["28110","is"],["28350",""],["28560","sliding"],["28920",""],["29280","elements"],["29760","over,"],["30130","out"],["30320","of"],["30410","the"],["30500","way."],["30830",""],["31110",""],["31390","How"],["31550","does"],["31680","this"],["31820","algorithm"],["32310","work"],["32570","in"],["32720","pseudocode?"],["33070",""],["33420",""],["33725",""],["34030","Well"],["34330","let's"],["34460","just"],["34630","arbitrarily"],["35005",""],["35380","say"],["35550","that"],["35690","the"],["35780","first"],["36120","element"],["36490","of"],["36570","the"],["36720","array"],["36980","is"],["37170","sorted."],["37450",""],["37730","We're"],["37860","building"],["38200","it in"],["38370","place."],["38770","We're"],["38870","gonna"],["38980",""],["39030","go"],["39290","one"],["39590","element"],["40000","at"],["40100","a"],["40200","time"],["40360","and"],["40450","build"],["40750","it,"],["40940",""],["41240","and"],["41470","so"],["41620","the"],["41710","first"],["41980","thing"],["42120","we"],["42220","see"],["42660","is"],["42840","a"],["42930","one"],["43190","element"],["43540","array."],["43890","And"],["44010","by"],["44140","definition,"],["44430",""],["44720","a"],["44790","one"],["45060","element"],["45450","array"],["45910",""],["46300","is"],["46460","sorted."],["46820",""],["47270",""],["47720","Then"],["47930","we'll"],["48030","repeat"],["48450","this"],["48620","process"],["48905",""],["49190","until--"],["49445",""],["49700","we'll repeat"],["49870","the"],["50080","following"],["50380","process"],["50850","until"],["51230","all"],["51460","of the"],["51580","elements"],["51900","are"],["51960","sorted."],["52340",""],["52620",""],["52900","Look"],["53170","at"],["53270","the"],["53350","next"],["53720","unsorted"],["53975",""],["54230","element"],["54640",""],["55050","and"],["55350","insert"],["55450","it"],["55765",""],["56080","into"],["56310","the"],["56400","sorted"],["56680",""],["56960","portion,"],["57460",""],["57770","by"],["57890","shifting"],["58275",""],["58660","the"],["58800","required"],["59060",""],["59320","number"],["59620","of"],["59760","elements"],["60210","out of"],["60420","the"],["60510","way."],["60810",""],["61245",""],["61680","Hopefully"],["61980","this"],["62170","visualization"],["62455",""],["62740","will"],["62820","help"],["62990","you"],["63070","see"],["63260","exactly"],["63580","what's"],["63750","going"],["63990","on"],["64254",""],["64519","with"],["64790","insertion"],["65209","sort."],["65489",""],["65980","So"],["66000","again,"],["66340","here's"],["66470","our"],["66610","entire"],["67110","unsorted"],["67280",""],["67530",""],["67610","array,"],["68010","all"],["68210","of the"],["68360","elements"],["68770","indicated"],["69250","in"],["69380","red."],["69740",""],["70150",""],["70560",""],["70970","And"],["71410","let's"],["71610","follow"],["71850","the"],["71940","steps"],["72160","of"],["72240","our"],["72350","pseudocode."],["72630",""],["72920",""],["73320","The"],["73410","first"],["73640","thing"],["73750","we"],["73870","do,"],["74130",""],["74390","is"],["74520","we"],["74610","call"],["74790","the"],["74870","first"],["75240","element"],["75610","of"],["75680","the"],["75790","array,"],["76170",""],["76450","sorted."],["76710",""],["76970","So we're"],["77340","just gonna"],["77740","say"],["78000","five,"],["78285",""],["78570",""],["78865",""],["79160","you're"],["79300","now"],["79450","sorted."],["79860",""],["80213",""],["80566",""],["80920","Then"],["81110","we"],["81220","look"],["81440","at"],["81520","the"],["81610","next"],["82050","unsorted"],["82325",""],["82600","element"],["83000",""],["83300","of"],["83470","the"],["83610","array"],["83930",""],["84250",""],["84570","and"],["84890","we"],["85140","want"],["85270","to"],["85350","insert"],["85790","that"],["86030","into"],["86210","the"],["86320","sorted"],["86615",""],["86910","portion,"],["87260",""],["87610","by"],["87720","shifting"],["88000",""],["88280","elements"],["88730","over."],["89100",""],["89460",""],["89500",""],["89750","So"],["89940","two"],["90215",""],["90490","is"],["90660","the"],["90750","next"],["91170","unsorted"],["91460",""],["91750","element"],["92120","of"],["92190","the"],["92320","array."],["92700",""],["93085",""],["93470","Clearly"],["93890","it"],["93990","belongs"],["94370","before"],["94750","the"],["94840","five,"],["95200",""],["95560","so"],["95690","what we're"],["95860","gonna"],["95960",""],["96040","do"],["96250","is"],["96330","sort"],["96500","of"],["96580","hold"],["96960","two"],["97160","aside"],["97530","for"],["97660","a"],["97710","second,"],["98170",""],["98475",""],["98780","shift"],["99190","five"],["99550","over,"],["99970",""],["100245",""],["100520","and"],["100680","then"],["100860","insert"],["101115",""],["101370","two"],["101580","before"],["101970","five,"],["102280","where"],["102450","to"],["102600","should"],["102920","go."],["103210","And"],["103390","now"],["103530","we"],["103610","can"],["103720","say"],["103860","that"],["104060","two"],["104350","is"],["104450","sorted."],["104930",""],["105280","So"],["105390","as"],["105490","you"],["105580","can"],["105680","see,"],["105860","we've"],["106040","only"],["106260","so"],["106420","far"],["106650","looked"],["106980","at"],["107280","two"],["107530","elements"],["107910","of"],["108040","the"],["108220","array."],["108400","We"],["108480","haven't"],["108770","looked"],["108940","at"],["109010","the"],["109090","rest"],["109360","at"],["109420","all,"],["109860",""],["110130","but"],["110400","we've"],["110600","got"],["110800","those"],["111020","two"],["111180","elements"],["111600","sorted"],["112100","by"],["112270","way"],["112500","of"],["112580","the"],["112820","shifting"],["113280","mechanism."],["113585",""],["113890",""],["114236",""],["114582","So"],["114930","we"],["115020","repeat"],["115280","the"],["115360","process"],["115730","again."],["116120",""],["116410","Look"],["116580","at"],["116650","the"],["116740","next"],["117010","unsorted"],["117430","element,"],["117810","that's"],["118050","one."],["118305",""],["118560",""],["118850","Let's"],["119070","hold"],["119280","that"],["119430","aside"],["119790","for"],["119940","a"],["120040","second,"],["120370",""],["120630",""],["120890","shift"],["121390","everything"],["121870","over,"],["122350",""],["122700",""],["123050","and"],["123210","put"],["123430","one"],["123720",""],["124010","where"],["124190","it"],["124320","should"],["124500","go."],["124750",""],["125160",""],["125570","Again,"],["125860","still,"],["126210","we've"],["126350","only"],["126590","ever"],["126750","looked"],["127010","at"],["127100","one,"],["127390","two,"],["127680","and"],["127820","five."],["128110","We"],["128199","don't"],["128370","know"],["128490","what"],["128660","else"],["128889","is"],["129000","coming,"],["129285","but"],["129570","we've"],["129750","sorted"],["130110",""],["130190","those"],["130430","three"],["130590","elements."],["130880",""],["131170",""],["131606",""],["132042",""],["132480","Next"],["132710","unsorted"],["133100","element"],["133560","is"],["133970","three,"],["134240",""],["134510",""],["134730","so"],["134910","we'll"],["135030","set"],["135230","it"],["135300","aside."],["135790",""],["136030","We'll"],["136160","shift"],["136460","over"],["136890","what"],["137030","we"],["137140","need"],["137370","to"],["137600","which,"],["137840","this"],["138000","time"],["138200","is"],["138320","not"],["138650","everything"],["138945",""],["139240","as"],["139340","in"],["139400","the"],["139470","previous"],["139940","two cases,"],["140290","it's"],["140490","just"],["140680","the"],["140760","five."],["141240",""],["141530",""],["141820","And then"],["142020","we'll"],["142100","stick"],["142370","three"],["142680","in,"],["143000","between"],["143330","the"],["143420","two"],["143580","and the"],["143720","five."],["144180",""],["144600",""],["145020",""],["145440","Six"],["145775",""],["146110","is"],["146270","the"],["146350","next"],["146640","unsorted"],["147080","element"],["147420","to"],["147510","the"],["147630","array."],["148000","And"],["148350","in"],["148510","fact"],["148700","six"],["148990","is"],["149130","greater"],["149450","than"],["149610","five,"],["149900","so"],["150010","we don't"],["150130","even"],["150220","need"],["150380","to"],["150450","do"],["150600","any"],["150720","swapping."],["151140","We"],["151230","can"],["151340","just"],["151570","tack"],["151890","six"],["152110","right"],["152310","on"],["152690",""],["152900","to"],["153030","the"],["153210","end"],["153490","of"],["153630","the"],["153710","sorted"],["153965",""],["154220","portion."],["154640",""],["154996",""],["155352",""],["155710","Lastly,"],["156160","four"],["156420",""],["156680",""],["156900","is"],["157050","the"],["157150","last"],["157500","unsorted"],["157920","element."],["158270","So"],["158380","we'll"],["158490","set"],["158730","it"],["159170","aside,"],["159470",""],["159770","shift"],["160120","over"],["160250","the"],["160350","elements"],["160650","we"],["160730","need"],["160870","to"],["160950","shift"],["161320","over,"],["161650",""],["162060","and then"],["162300","put"],["162460","four"],["162660","where"],["162800","it"],["162860","belongs."],["163135",""],["163410",""],["163780","And"],["163930","now"],["164070","look,"],["164290","we've"],["164410","sort"],["164670","of"],["164760","all"],["165030","the"],["165150","elements."],["165465",""],["165780",""],["166150",""],["166520","Notice"],["166670","with"],["166790","insertion"],["167250","sort,"],["167590","we"],["167690","didn't"],["167950","have"],["168150","to"],["168260","go"],["168400","back"],["168770","and"],["168880","forth"],["169200","across"],["169600","the"],["169750","array."],["170240","We"],["170480","only"],["170740","went"],["171020","across"],["171480","the"],["171620","array"],["171880","one"],["172160",""],["172440","time,"],["172900",""],["173160","and"],["173400","we"],["173470","shifted"],["173790",""],["174110","things"],["174470",""],["174720","that"],["174860","we'd"],["175180",""],["175500","already"],["175850","encountered,"],["176175",""],["176500",""],["176860","in"],["177000","order"],["177140","to"],["177210","make"],["177410","room"],["177670",""],["177930","for"],["178090","the"],["178190","new"],["178410","elements."],["178745",""],["179080",""],["179475",""],["179870","So"],["180040","what's"],["180200","the"],["180300","worst"],["180550","case"],["180750","scenario"],["181110","with"],["181340","insertion"],["181615",""],["181890","sort?"],["182330",""],["182820","In"],["182900","the"],["182980","worst"],["183230","case,"],["183550","the"],["183650","array"],["183800","is in"],["183920","reverse"],["184185",""],["184450","order."],["184850",""],["185090","You"],["185240","have"],["185370","to"],["185460","shift"],["185830",""],["186200","each"],["186510","of"],["186610","the"],["186860","n"],["187190","elements"],["187540",""],["187890",""],["188120","up"],["188310","to"],["188580","n"],["188970","positions,"],["189455",""],["189940",""],["190270","every"],["190520","single"],["190790","time"],["191070","we"],["191180","make"],["191410","an"],["191510","insertion."],["191780",""],["192050",""],["192465",""],["192880","That's"],["193370","a"],["193460","lot"],["193860","of"],["193920","shifting."],["194410",""],["194846",""],["195282",""],["195720","In"],["195840","the"],["195920","best"],["196240","case,"],["196650","the"],["196840","array is"],["197200","perfectly"],["197610","sorted."],["197870",""],["198130","And"],["198290","sort"],["198430","of"],["198510","like"],["198630","what"],["198720","happened"],["198990","with"],["199140","five"],["199540","and"],["199660","six"],["200000","in"],["200070","the"],["200170","example,"],["200425",""],["200680","where"],["200990",""],["201300","we"],["201430","could"],["201550","just"],["201760","tack"],["202040","it"],["202130","on"],["202340","without"],["202540","having"],["202750","to"],["202820","do"],["202950","any"],["203070","shifting,"],["203325",""],["203580",""],["203800","we'd"],["203980","essentially"],["204360","do"],["204540","that."],["204820","If"],["204900","you"],["204990","imagine"],["205350","that our"],["205580","array"],["205835",""],["206090","was"],["206250","one"],["206560","through"],["206750","six,"],["207030",""],["207310",""],["207560","we'd"],["207750","start"],["208010","off by"],["208100","declaring"],["208570","one is"],["208840","sorted."],["209110",""],["209380",""],["209640",""],["209900","Two"],["210120","comes"],["210350","after"],["210610","one"],["210880","so"],["210970","we"],["211060","can"],["211170","just"],["211340","say,"],["211540","OK,"],["211740","well"],["211910","one"],["212100","and"],["212220","two"],["212390","are"],["212480","sorted."],["212890",""],["213300","Three"],["213560","comes"],["213750","after"],["214000","two"],["214280","so,"],["214520","OK,"],["214740","one"],["214980","and"],["215090","two"],["215240","and"],["215350","three"],["215520","are"],["215610","sorted."],["215900",""],["216190","We're"],["216320","not"],["216480","making"],["216790","any"],["216950","swaps,"],["217360","we're"],["217450","just"],["217630","moving"],["218050","this"],["218260","arbitrary"],["218570",""],["218880","line"],["219235",""],["219590","between"],["219880","sorted"],["220150","and"],["220280","unsorted"],["220520",""],["220960",""],["221295",""],["221630","as"],["221830","we"],["221930","go."],["222150",""],["222460","As"],["222670","effectively"],["222925",""],["223180","as"],["223270","we"],["223340","did"],["223470","in the"],["223530","example,"],["224030","turning"],["224290","elements"],["224710","blue,"],["225140",""],["225410","as"],["225630","we"],["225740","proceed."],["226190",""],["226580",""],["226970","So"],["227020","what's"],["227190","the"],["227280","worst"],["227520","case"],["227720","runtime,"],["227995","then?"],["228270","Remember,"],["228610","if we"],["228830","have"],["229110","to"],["229170","shift"],["229510","each"],["229650","of"],["229760","the"],["230000","n"],["230250","elements"],["230640","possibly"],["230900",""],["231160","n"],["231440","positions,"],["231830",""],["232220",""],["232430","hopefully"],["232620","that"],["232760","gives"],["232910","you"],["232980","an"],["233060","idea"],["233380","that"],["233500","the"],["233580","worst"],["233820","case"],["234020","runtime"],["234500","is"],["234940",""],["235260","Big"],["235380","O"],["235600","of"],["235910",""],["236310","n"],["236540","squared."],["236870",""],["237200",""],["237485",""],["237770","If"],["237960","the"],["238080","array is"],["238380","perfectly"],["238840","sorted,"],["239150",""],["239460",""],["239740","all"],["239880","we"],["239960","have"],["240030","to"],["240100","do"],["240220","is"],["240360","look"],["240640","at"],["240710","every"],["240930","single"],["241240","element"],["241710","once,"],["242025",""],["242340",""],["242720",""],["243100","and"],["243250","then"],["243610","we're"],["243800","done."],["244140",""],["244480","So"],["244510","in the"],["244630","best"],["244970","case,"],["245260","it's"],["245515",""],["245770","omega"],["246100",""],["246430","of"],["246850","n."],["247230",""],["247633",""],["248036",""],["248440","I'm"],["248650","Doug"],["248880","Lloyd."],["249240",""],["249490","This"],["249850","is"],["250210","CS50."],["250510",""],["250810",""],["251110",""],["251410",""],["251710",""],["252010",""],["252310",""],["252610",""],["252910",""]],"paragraphs":[0,2826,5660,26910,38770,47720,65980,80920,105280,114582,125570,132480,145440,155710,166520,179870,195720,204820,216190,226970,237770,248440,251110],"speakers":{"5660":"DOUG LLOYD"}}