[{"data":1,"prerenderedAt":3764},["ShallowReactive",2],{"item-lessons-light-ch15-advanced-collections":3,"item-examples-light-ch15-advanced-collections":444,"item-exercises-light-ch15-advanced-collections":753,"item-lesson-full-ch15-advanced-collections-15":1070,"item-example-full-ch15-advanced-collections-15":2275,"item-exercise-full-ch15-advanced-collections-15":2832},[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276,280,284,288,292,296,300,304,308,312,316,320,324,328,332,336,340,344,348,352,356,360,364,368,372,376,380,384,388,392,396,400,404,408,412,416,420,424,428,432,436,440],{"path":5,"title":6,"stem":7},"\u002Fshockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F1-why-java-for-frc","Why Java for FRC?","shockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F1.1-why-java-for-frc",{"path":9,"title":10,"stem":11},"\u002Fshockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming and Compilers","shockwave-curriculum\u002Flessons\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":13,"title":14,"stem":15},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F1-variables-and-data-types","Variables & Data Types","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.1-variables-and-data-types",{"path":17,"title":18,"stem":19},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2-expressions-and-output","Expressions & Output","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.2-expressions-and-output",{"path":21,"title":22,"stem":23},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F3-assignment-and-input","Assignment & Input","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.3-assignment-and-input",{"path":25,"title":26,"stem":27},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F4-casting-and-ranges-of-values","Casting & Ranges of Values","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.4-casting-and-ranges-of-values",{"path":29,"title":30,"stem":31},"\u002Fshockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F5-compound-assignment-operators","Compound Assignment Operators","shockwave-curriculum\u002Flessons\u002Fch02-variables-and-types\u002F2.5-compound-assignment-operators",{"path":33,"title":34,"stem":35},"\u002Fshockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F1-apis-and-libraries","APIs and Libraries","shockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3.1-apis-and-libraries",{"path":37,"title":38,"stem":39},"\u002Fshockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F2-documentation-with-comments-and-preconditions","Documentation with Comments and Preconditions","shockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3.2-documentation-with-comments-and-preconditions",{"path":41,"title":42,"stem":43},"\u002Fshockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3-packages-and-imports","Packages & Imports","shockwave-curriculum\u002Flessons\u002Fch03-apis-libraries-and-documentation\u002F3.3-packages-and-imports",{"path":45,"title":46,"stem":47},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F1-methods-signatures-and-parameters","Methods, Signatures & Parameters","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.1-methods-signatures-and-parameters",{"path":49,"title":50,"stem":51},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F2-calling-class-methods","Calling Class Methods","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.2-calling-class-methods",{"path":53,"title":54,"stem":55},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F3-using-the-math-class","Using the Math Class","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.3-using-the-math-class",{"path":57,"title":58,"stem":59},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4-objects-instances-of-classes","Objects — Instances of Classes","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.4-objects-instances-of-classes",{"path":61,"title":62,"stem":63},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F5-creating-and-initializing-objects-constructors","Creating & Initializing Objects: Constructors","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.5-creating-and-initializing-objects-constructors",{"path":65,"title":66,"stem":67},"\u002Fshockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F6-calling-instance-methods","Calling Instance Methods","shockwave-curriculum\u002Flessons\u002Fch04-using-objects-and-calling-methods\u002F4.6-calling-instance-methods",{"path":69,"title":70,"stem":71},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F1-5.2-if-statements-and-for-loops","Control Structures: if Statements & For Loops","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.1-5.2-if-statements-and-for-loops",{"path":73,"title":74,"stem":75},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":77,"title":78,"stem":79},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F11-informal-runtime-analysis-of-loops","Informal Runtime Analysis of Loops","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.11-informal-runtime-analysis-of-loops",{"path":81,"title":82,"stem":83},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F12-switch-statements-and-expressions","switch Statements and Expressions","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.12-switch-statements-and-expressions",{"path":85,"title":86,"stem":87},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F3-algorithms-with-selection-and-repetition","Algorithms with Selection and Repetition","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.3-algorithms-with-selection-and-repetition",{"path":89,"title":90,"stem":91},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":93,"title":94,"stem":95},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5-nested-if-statements","Nested if Statements","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.5-nested-if-statements",{"path":97,"title":98,"stem":99},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F6-compound-boolean-expressions","Compound Boolean Expressions","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.6-compound-boolean-expressions",{"path":101,"title":102,"stem":103},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F7-comparing-boolean-expressions-de-morgans-laws","Comparing Boolean Expressions (De Morgan's Laws)","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.7-comparing-boolean-expressions-de-morgans-laws",{"path":105,"title":106,"stem":107},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F8-while-loops","While Loops","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.8-while-loops",{"path":109,"title":110,"stem":111},"\u002Fshockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F9-implementing-selection-and-iteration-algorithms","Implementing Selection and Iteration Algorithms","shockwave-curriculum\u002Flessons\u002Fch05-control-structures\u002F5.9-implementing-selection-and-iteration-algorithms",{"path":113,"title":114,"stem":115},"\u002Fshockwave-curriculum\u002Flessons\u002Fch06-strings\u002F1-strings","Strings","shockwave-curriculum\u002Flessons\u002Fch06-strings\u002F6.1-strings",{"path":117,"title":118,"stem":119},"\u002Fshockwave-curriculum\u002Flessons\u002Fch06-strings\u002F2-string-algorithms","String Algorithms","shockwave-curriculum\u002Flessons\u002Fch06-strings\u002F6.2-string-algorithms",{"path":121,"title":122,"stem":123},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F1-anatomy-of-a-java-class","The Class Blueprint","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.1-anatomy-of-a-java-class",{"path":125,"title":126,"stem":127},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F2-methods-how-to-write-them","Methods: How to Write Them","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.2-methods-how-to-write-them",{"path":129,"title":130,"stem":131},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F3-methods-passing-and-returning-references-of-an-object","Methods: Passing & Returning References of an Object","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.3-methods-passing-and-returning-references-of-an-object",{"path":133,"title":134,"stem":135},"\u002Fshockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F4-class-static-variables-and-methods","Class (static) Variables & Methods","shockwave-curriculum\u002Flessons\u002Fch07-the-class-blueprint\u002F7.4-class-static-variables-and-methods",{"path":137,"title":138,"stem":139},"\u002Fshockwave-curriculum\u002Flessons\u002Fch08-constructors-and-this\u002F1-8.2-constructors-and-this","Constructors & \"this\"","shockwave-curriculum\u002Flessons\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this",{"path":141,"title":142,"stem":143},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F1-array-creation-and-access","Array Creation and Access","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.1-array-creation-and-access",{"path":145,"title":146,"stem":147},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F2-arraylist-and-its-methods","ArrayList and its Methods","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.2-arraylist-and-its-methods",{"path":149,"title":150,"stem":151},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","HashMap (Dictionary) Data Structure","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":153,"title":154,"stem":155},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":157,"title":158,"stem":159},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F5-implementing-array-algorithms","Implementing Array Algorithms","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.5-implementing-array-algorithms",{"path":161,"title":162,"stem":163},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":165,"title":166,"stem":167},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F7-implementing-arraylist-algorithms","Implementing ArrayList Algorithms","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.7-implementing-arraylist-algorithms",{"path":169,"title":170,"stem":171},"\u002Fshockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F8-using-text-files","Using Text Files","shockwave-curriculum\u002Flessons\u002Fch09-storing-data\u002F9.8-using-text-files",{"path":173,"title":174,"stem":175},"\u002Fshockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F1-2d-array-creation-and-access","2D Array Creation and Access","shockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F10.1-2d-array-creation-and-access",{"path":177,"title":178,"stem":179},"\u002Fshockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F2-2d-array-traversals-nested-loops","2D Array Traversals: Nested Loops","shockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F10.2-2d-array-traversals-nested-loops",{"path":181,"title":182,"stem":183},"\u002Fshockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F3-implementing-2d-array-algorithms","Implementing 2D Array Algorithms","shockwave-curriculum\u002Flessons\u002Fch10-2d-arrays\u002F10.3-implementing-2d-array-algorithms",{"path":185,"title":186,"stem":187},"\u002Fshockwave-curriculum\u002Flessons\u002Fch11-enums-named-choices\u002F11-enums-named-choices","Enums: Named Choices","shockwave-curriculum\u002Flessons\u002Fch11-enums-named-choices\u002F11-enums-named-choices",{"path":189,"title":190,"stem":191},"\u002Fshockwave-curriculum\u002Flessons\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch","Exceptions & try\u002Fcatch","shockwave-curriculum\u002Flessons\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch",{"path":193,"title":194,"stem":195},"\u002Fshockwave-curriculum\u002Flessons\u002Fch13-common-gotchas\u002F13-common-gotchas","Common Gotchas","shockwave-curriculum\u002Flessons\u002Fch13-common-gotchas\u002F13-common-gotchas",{"path":197,"title":198,"stem":199},"\u002Fshockwave-curriculum\u002Flessons\u002Fch14-why-design-patterns\u002F14-why-design-patterns","Why Design Patterns?","shockwave-curriculum\u002Flessons\u002Fch14-why-design-patterns\u002F14-why-design-patterns",{"path":201,"title":202,"stem":203},"\u002Fshockwave-curriculum\u002Flessons\u002Fch15-advanced-collections\u002F15-advanced-collections","Advanced Collections (Set\u002FQueue\u002FMap)","shockwave-curriculum\u002Flessons\u002Fch15-advanced-collections\u002F15-advanced-collections",{"path":205,"title":206,"stem":207},"\u002Fshockwave-curriculum\u002Flessons\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics","Writing Your Own Generics","shockwave-curriculum\u002Flessons\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics",{"path":209,"title":210,"stem":211},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F1-inheritance-superclass-subclass","Inheritance, Superclass, Subclass","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.1-inheritance-superclass-subclass",{"path":213,"title":214,"stem":215},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F2-inheritance-and-constructors","Inheritance and Constructors","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.2-inheritance-and-constructors",{"path":217,"title":218,"stem":219},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F3-inheritance-hierarchies","Inheritance Hierarchies","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies",{"path":221,"title":222,"stem":223},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F4-object-superclass","Object Superclass","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass",{"path":225,"title":226,"stem":227},"\u002Fshockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F5-abstract-classes-and-methods","Abstract Classes and Methods","shockwave-curriculum\u002Flessons\u002Fch17-inheritance-and-abstractions\u002F17.5-abstract-classes-and-methods",{"path":229,"title":230,"stem":231},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F1-overriding-methods","Overriding Methods","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.1-overriding-methods",{"path":233,"title":234,"stem":235},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F2-super-keyword","super Keyword","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.2-super-keyword",{"path":237,"title":238,"stem":239},"\u002Fshockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F3-polymorphism","Polymorphism","shockwave-curriculum\u002Flessons\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism",{"path":241,"title":242,"stem":243},"\u002Fshockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts","Interfaces as Contracts","shockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts",{"path":245,"title":246,"stem":247},"\u002Fshockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F1-lambdas-and-method-references","Lambdas & Method References","shockwave-curriculum\u002Flessons\u002Fch19-interfaces-as-contracts\u002F19.1-lambdas-and-method-references",{"path":249,"title":250,"stem":251},"\u002Fshockwave-curriculum\u002Flessons\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern","The IO-Layer Pattern","shockwave-curriculum\u002Flessons\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern",{"path":253,"title":254,"stem":255},"\u002Fshockwave-curriculum\u002Flessons\u002Fch21-static-factories\u002F21-static-factories","Static Factories","shockwave-curriculum\u002Flessons\u002Fch21-static-factories\u002F21-static-factories",{"path":257,"title":258,"stem":259},"\u002Fshockwave-curriculum\u002Flessons\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern","The Builder Pattern","shockwave-curriculum\u002Flessons\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern",{"path":261,"title":262,"stem":263},"\u002Fshockwave-curriculum\u002Flessons\u002Fch23-encapsulation-and-final\u002F1-scope-and-access","Access, final, and Immutability","shockwave-curriculum\u002Flessons\u002Fch23-encapsulation-and-final\u002F23.1-scope-and-access",{"path":265,"title":266,"stem":267},"\u002Fshockwave-curriculum\u002Flessons\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions","Optional: Avoiding Null Pointer Exceptions","shockwave-curriculum\u002Flessons\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions",{"path":269,"title":270,"stem":271},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F1-what-is-command-based-programming","What Is Command-Based Programming?","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.1-what-is-command-based-programming",{"path":273,"title":274,"stem":275},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F2-commands-and-command-compositions","Commands & Command Compositions","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.2-commands-and-command-compositions",{"path":277,"title":278,"stem":279},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F3-the-command-scheduler","The Command Scheduler","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.3-the-command-scheduler",{"path":281,"title":282,"stem":283},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F4-state-machines-logic","State Machines: Logic","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.4-state-machines-logic",{"path":285,"title":286,"stem":287},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F5-managing-transitions","Managing Transitions","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.5-managing-transitions",{"path":289,"title":290,"stem":291},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F6-binding-commands-to-triggers","Binding Commands to Triggers","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.6-binding-commands-to-triggers",{"path":293,"title":294,"stem":295},"\u002Fshockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F7-structuring-a-command-based-robot-project","Structuring a Command-Based Robot Project","shockwave-curriculum\u002Flessons\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project",{"path":297,"title":298,"stem":299},"\u002Fshockwave-curriculum\u002Flessons\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways","Architecture Takeaways","shockwave-curriculum\u002Flessons\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways",{"path":301,"title":302,"stem":303},"\u002Fshockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F1-abstraction-and-program-design","Abstraction and Program Design","shockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F27.1-abstraction-and-program-design",{"path":305,"title":306,"stem":307},"\u002Fshockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F2-impact-of-program-design","Impact of Program Design","shockwave-curriculum\u002Flessons\u002Fch27-program-design-and-abstraction\u002F27.2-impact-of-program-design",{"path":309,"title":310,"stem":311},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F1-searching-algorithms","Searching Algorithms","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.1-searching-algorithms",{"path":313,"title":314,"stem":315},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F2-sorting-algorithms","Sorting Algorithms","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.2-sorting-algorithms",{"path":317,"title":318,"stem":319},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F3-recursion","Recursion","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.3-recursion",{"path":321,"title":322,"stem":323},"\u002Fshockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F4-recursive-searching-and-sorting","Recursive Searching and Sorting","shockwave-curriculum\u002Flessons\u002Fch28-algorithms-searching-sorting-recursion\u002F28.4-recursive-searching-and-sorting",{"path":325,"title":326,"stem":327},"\u002Fshockwave-curriculum\u002Flessons\u002Fch29-git-and-github-basics\u002F1-coming-soon","Git & GitHub Basics — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch29-git-and-github-basics\u002F29.1-coming-soon",{"path":329,"title":330,"stem":331},"\u002Fshockwave-curriculum\u002Flessons\u002Fch30-git-history-and-merging\u002F1-coming-soon","Git — History & Merging — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch30-git-history-and-merging\u002F30.1-coming-soon",{"path":333,"title":334,"stem":335},"\u002Fshockwave-curriculum\u002Flessons\u002Fch31-dev-environment-and-tooling\u002F1-coming-soon","Dev Environment & Tooling — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch31-dev-environment-and-tooling\u002F31.1-coming-soon",{"path":337,"title":338,"stem":339},"\u002Fshockwave-curriculum\u002Flessons\u002Fch32-unit-testing\u002F1-coming-soon","Unit Testing — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch32-unit-testing\u002F32.1-coming-soon",{"path":341,"title":342,"stem":343},"\u002Fshockwave-curriculum\u002Flessons\u002Fch33-advantagekit-autologging\u002F1-coming-soon","AdvantageKit — AutoLogging — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch33-advantagekit-autologging\u002F33.1-coming-soon",{"path":345,"title":346,"stem":347},"\u002Fshockwave-curriculum\u002Flessons\u002Fch34-log-replay\u002F1-coming-soon","Log Replay — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch34-log-replay\u002F34.1-coming-soon",{"path":349,"title":350,"stem":351},"\u002Fshockwave-curriculum\u002Flessons\u002Fch35-advantagescope-i-visualization\u002F1-coming-soon","AdvantageScope I: Visualization — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch35-advantagescope-i-visualization\u002F35.1-coming-soon",{"path":353,"title":354,"stem":355},"\u002Fshockwave-curriculum\u002Flessons\u002Fch36-advantagescope-ii-custom-3d-assets\u002F1-coming-soon","AdvantageScope II: Custom 3D Assets — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch36-advantagescope-ii-custom-3d-assets\u002F36.1-coming-soon",{"path":357,"title":358,"stem":359},"\u002Fshockwave-curriculum\u002Flessons\u002Fch37-autonomous-i\u002F1-coming-soon","Autonomous I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch37-autonomous-i\u002F37.1-coming-soon",{"path":361,"title":362,"stem":363},"\u002Fshockwave-curriculum\u002Flessons\u002Fch38-autonomous-ii-pathplanner-and-trajectories\u002F1-coming-soon","Autonomous II: PathPlanner & Trajectories — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch38-autonomous-ii-pathplanner-and-trajectories\u002F38.1-coming-soon",{"path":365,"title":366,"stem":367},"\u002Fshockwave-curriculum\u002Flessons\u002Fch39-control-fundamentals\u002F1-coming-soon","Control Fundamentals — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch39-control-fundamentals\u002F39.1-coming-soon",{"path":369,"title":370,"stem":371},"\u002Fshockwave-curriculum\u002Flessons\u002Fch40-motion-profiles\u002F1-coming-soon","Motion Profiles — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch40-motion-profiles\u002F40.1-coming-soon",{"path":373,"title":374,"stem":375},"\u002Fshockwave-curriculum\u002Flessons\u002Fch41-hardware-fundamentals\u002F1-coming-soon","Hardware Fundamentals — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch41-hardware-fundamentals\u002F41.1-coming-soon",{"path":377,"title":378,"stem":379},"\u002Fshockwave-curriculum\u002Flessons\u002Fch42-photonvision\u002F1-coming-soon","PhotonVision — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch42-photonvision\u002F42.1-coming-soon",{"path":381,"title":382,"stem":383},"\u002Fshockwave-curriculum\u002Flessons\u002Fch43-apriltags-and-pose\u002F1-coming-soon","AprilTags & Pose — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch43-apriltags-and-pose\u002F43.1-coming-soon",{"path":385,"title":386,"stem":387},"\u002Fshockwave-curriculum\u002Flessons\u002Fch44-subsystems-i\u002F1-coming-soon","Subsystems I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch44-subsystems-i\u002F44.1-coming-soon",{"path":389,"title":390,"stem":391},"\u002Fshockwave-curriculum\u002Flessons\u002Fch45-subsystems-ii-advanced\u002F1-coming-soon","Subsystems II — Advanced — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch45-subsystems-ii-advanced\u002F45.1-coming-soon",{"path":393,"title":394,"stem":395},"\u002Fshockwave-curriculum\u002Flessons\u002Fch46-team-utilities-i\u002F1-coming-soon","Team Utilities I — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch46-team-utilities-i\u002F46.1-coming-soon",{"path":397,"title":398,"stem":399},"\u002Fshockwave-curriculum\u002Flessons\u002Fch47-field-constants\u002F1-coming-soon","Field Constants — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch47-field-constants\u002F47.1-coming-soon",{"path":401,"title":402,"stem":403},"\u002Fshockwave-curriculum\u002Flessons\u002Fch48-troubleshooting-i-runtime-debug\u002F1-coming-soon","Troubleshooting I — Runtime Debug — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch48-troubleshooting-i-runtime-debug\u002F48.1-coming-soon",{"path":405,"title":406,"stem":407},"\u002Fshockwave-curriculum\u002Flessons\u002Fch49-troubleshooting-ii-can-and-sim\u002F1-coming-soon","Troubleshooting II: CAN & Sim — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch49-troubleshooting-ii-can-and-sim\u002F49.1-coming-soon",{"path":409,"title":410,"stem":411},"\u002Fshockwave-curriculum\u002Flessons\u002Fch50-vendor-libraries-talonfx\u002F1-coming-soon","Vendor Libraries: TalonFX — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch50-vendor-libraries-talonfx\u002F50.1-coming-soon",{"path":413,"title":414,"stem":415},"\u002Fshockwave-curriculum\u002Flessons\u002Fch51-robot-alerts\u002F1-coming-soon","Robot Alerts — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch51-robot-alerts\u002F51.1-coming-soon",{"path":417,"title":418,"stem":419},"\u002Fshockwave-curriculum\u002Flessons\u002Fch52-wpilib-commands\u002F1-coming-soon","WPILib Commands — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch52-wpilib-commands\u002F52.1-coming-soon",{"path":421,"title":422,"stem":423},"\u002Fshockwave-curriculum\u002Flessons\u002Fch53-wpilib-geometry\u002F1-coming-soon","WPILib Geometry — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch53-wpilib-geometry\u002F53.1-coming-soon",{"path":425,"title":426,"stem":427},"\u002Fshockwave-curriculum\u002Flessons\u002Fch54-networktables\u002F1-coming-soon","NetworkTables — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch54-networktables\u002F54.1-coming-soon",{"path":429,"title":430,"stem":431},"\u002Fshockwave-curriculum\u002Flessons\u002Fch55-command-scheduler\u002F1-coming-soon","Command Scheduler — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch55-command-scheduler\u002F55.1-coming-soon",{"path":433,"title":434,"stem":435},"\u002Fshockwave-curriculum\u002Flessons\u002Fch56-wpilib-timers\u002F1-coming-soon","WPILib Timers — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch56-wpilib-timers\u002F56.1-coming-soon",{"path":437,"title":438,"stem":439},"\u002Fshockwave-curriculum\u002Flessons\u002Fch57-wpilib-triggers\u002F1-coming-soon","WPILib Triggers — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch57-wpilib-triggers\u002F57.1-coming-soon",{"path":441,"title":442,"stem":443},"\u002Fshockwave-curriculum\u002Flessons\u002Fch58-vendor-units-and-conversions\u002F1-coming-soon","Vendor Units & Conversions — Coming Soon","shockwave-curriculum\u002Flessons\u002Fch58-vendor-units-and-conversions\u002F58.1-coming-soon",[445,449,453,457,461,465,469,473,477,481,485,489,493,497,501,505,509,513,517,521,525,529,533,537,541,545,549,553,557,561,565,569,573,577,581,585,589,593,597,601,605,609,613,617,621,625,629,633,637,641,645,649,653,657,661,665,669,673,677,681,685,689,693,697,701,705,709,713,717,721,725,729,733,737,741,745,749],{"path":446,"title":447,"stem":448},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming and Compilers — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":450,"title":451,"stem":452},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F1-variables-and-data-types","Variables & Data Types — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.1-variables-and-data-types",{"path":454,"title":455,"stem":456},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2-expressions-and-output","Expressions & Output — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.2-expressions-and-output",{"path":458,"title":459,"stem":460},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F3-assignment-and-input","Assignment & Input — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.3-assignment-and-input",{"path":462,"title":463,"stem":464},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F4-casting-and-ranges-of-values","Casting & Ranges of Values — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.4-casting-and-ranges-of-values",{"path":466,"title":467,"stem":468},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F5-compound-assignment-operators","Compound Assignment Operators — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch02-variables-and-types\u002F2.5-compound-assignment-operators",{"path":470,"title":471,"stem":472},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F1-apis-and-libraries","APIs and Libraries — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3.1-apis-and-libraries",{"path":474,"title":475,"stem":476},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F2-documentation-with-comments-and-preconditions","Documentation with Comments and Preconditions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3.2-documentation-with-comments-and-preconditions",{"path":478,"title":479,"stem":480},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3-packages-and-imports","Packages & Imports — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch03-apis-libraries-and-documentation\u002F3.3-packages-and-imports",{"path":482,"title":483,"stem":484},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F1-methods-signatures-and-parameters","Methods, Signatures & Parameters — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.1-methods-signatures-and-parameters",{"path":486,"title":487,"stem":488},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F2-calling-class-methods","Calling Class Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.2-calling-class-methods",{"path":490,"title":491,"stem":492},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F3-using-the-math-class","Using the Math Class — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.3-using-the-math-class",{"path":494,"title":495,"stem":496},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4-objects-instances-of-classes","Objects — Instances of Classes — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.4-objects-instances-of-classes",{"path":498,"title":499,"stem":500},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F5-creating-and-initializing-objects-constructors","Creating & Initializing Objects: Constructors — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.5-creating-and-initializing-objects-constructors",{"path":502,"title":503,"stem":504},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F6-calling-instance-methods","Calling Instance Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch04-using-objects-and-calling-methods\u002F4.6-calling-instance-methods",{"path":506,"title":507,"stem":508},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F1-5.2-if-statements-and-for-loops","if Statements & For Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.1-5.2-if-statements-and-for-loops",{"path":510,"title":511,"stem":512},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":514,"title":515,"stem":516},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F11-informal-runtime-analysis-of-loops","Informal Runtime Analysis of Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.11-informal-runtime-analysis-of-loops",{"path":518,"title":519,"stem":520},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F12-switch-statements-and-expressions","switch Statements and Expressions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.12-switch-statements-and-expressions",{"path":522,"title":523,"stem":524},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F3-algorithms-with-selection-and-repetition","Algorithms with Selection and Repetition — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.3-algorithms-with-selection-and-repetition",{"path":526,"title":527,"stem":528},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":530,"title":531,"stem":532},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5-nested-if-statements","Nested if Statements — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.5-nested-if-statements",{"path":534,"title":535,"stem":536},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F6-compound-boolean-expressions","Compound Boolean Expressions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.6-compound-boolean-expressions",{"path":538,"title":539,"stem":540},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F7-comparing-boolean-expressions-de-morgans-laws","Comparing Boolean Expressions (De Morgan's Laws) — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.7-comparing-boolean-expressions-de-morgans-laws",{"path":542,"title":543,"stem":544},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F8-while-loops","While Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.8-while-loops",{"path":546,"title":547,"stem":548},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F9-implementing-selection-and-iteration-algorithms","Implementing Selection and Iteration Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch05-control-structures\u002F5.9-implementing-selection-and-iteration-algorithms",{"path":550,"title":551,"stem":552},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F1-strings","Strings — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F6.1-strings",{"path":554,"title":555,"stem":556},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F2-string-algorithms","String Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch06-strings\u002F6.2-string-algorithms",{"path":558,"title":559,"stem":560},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F1-anatomy-of-a-java-class","Anatomy of a Java Class — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.1-anatomy-of-a-java-class",{"path":562,"title":563,"stem":564},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F2-methods-how-to-write-them","Methods: How to Write Them — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.2-methods-how-to-write-them",{"path":566,"title":567,"stem":568},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F3-methods-passing-and-returning-references-of-an-object","Methods: Passing & Returning References of an Object — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.3-methods-passing-and-returning-references-of-an-object",{"path":570,"title":571,"stem":572},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F4-class-static-variables-and-methods","Class (static) Variables & Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch07-the-class-blueprint\u002F7.4-class-static-variables-and-methods",{"path":574,"title":575,"stem":576},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch08-constructors-and-this\u002F1-8.2-constructors-and-this","Constructors & \"this\" — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this",{"path":578,"title":579,"stem":580},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F1-array-creation-and-access","Array Creation and Access — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.1-array-creation-and-access",{"path":582,"title":583,"stem":584},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F2-arraylist-and-its-methods","ArrayList and its Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.2-arraylist-and-its-methods",{"path":586,"title":587,"stem":588},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","HashMap (Dictionary) Data Structure — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":590,"title":591,"stem":592},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":594,"title":595,"stem":596},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F5-implementing-array-algorithms","Implementing Array Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.5-implementing-array-algorithms",{"path":598,"title":599,"stem":600},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":602,"title":603,"stem":604},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F7-implementing-arraylist-algorithms","Implementing ArrayList Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.7-implementing-arraylist-algorithms",{"path":606,"title":607,"stem":608},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F8-using-text-files","Using Text Files — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch09-storing-data\u002F9.8-using-text-files",{"path":610,"title":611,"stem":612},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F1-2d-array-creation-and-access","2D Array Creation and Access — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F10.1-2d-array-creation-and-access",{"path":614,"title":615,"stem":616},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F2-2d-array-traversals-nested-loops","2D Array Traversals: Nested Loops — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F10.2-2d-array-traversals-nested-loops",{"path":618,"title":619,"stem":620},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F3-implementing-2d-array-algorithms","Implementing 2D Array Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch10-2d-arrays\u002F10.3-implementing-2d-array-algorithms",{"path":622,"title":623,"stem":624},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch11-enums-named-choices\u002F11-enums-named-choices","Enums: Named Choices — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch11-enums-named-choices\u002F11-enums-named-choices",{"path":626,"title":627,"stem":628},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch","Exceptions & try\u002Fcatch — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch",{"path":630,"title":631,"stem":632},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch13-common-gotchas\u002F13-common-gotchas","Common Gotchas — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch13-common-gotchas\u002F13-common-gotchas",{"path":634,"title":635,"stem":636},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch15-advanced-collections\u002F15-advanced-collections","Advanced Collections (Set\u002FQueue\u002FMap) — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch15-advanced-collections\u002F15-advanced-collections",{"path":638,"title":639,"stem":640},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics","Writing Your Own Generics — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics",{"path":642,"title":643,"stem":644},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F1-inheritance-superclass-subclass","Inheritance, Superclass, Subclass — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.1-inheritance-superclass-subclass",{"path":646,"title":647,"stem":648},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F2-inheritance-and-constructors","Inheritance and Constructors — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.2-inheritance-and-constructors",{"path":650,"title":651,"stem":652},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F3-inheritance-hierarchies","Inheritance Hierarchies — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies",{"path":654,"title":655,"stem":656},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F4-object-superclass","Object Superclass — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass",{"path":658,"title":659,"stem":660},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F5-abstract-classes-and-methods","Abstract Classes and Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch17-inheritance-and-abstractions\u002F17.5-abstract-classes-and-methods",{"path":662,"title":663,"stem":664},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F1-overriding-methods","Overriding Methods — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F18.1-overriding-methods",{"path":666,"title":667,"stem":668},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F2-super-keyword","super Keyword — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F18.2-super-keyword",{"path":670,"title":671,"stem":672},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F3-polymorphism","Polymorphism — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism",{"path":674,"title":675,"stem":676},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts","Interfaces as Contracts — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts",{"path":678,"title":679,"stem":680},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F1-lambdas-and-method-references","Lambdas & Method References — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch19-interfaces-as-contracts\u002F19.1-lambdas-and-method-references",{"path":682,"title":683,"stem":684},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern","The IO-Layer Pattern — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern",{"path":686,"title":687,"stem":688},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch21-static-factories\u002F21-static-factories","Static Factories — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch21-static-factories\u002F21-static-factories",{"path":690,"title":691,"stem":692},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern","The Builder Pattern — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern",{"path":694,"title":695,"stem":696},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch23-encapsulation-and-final\u002F1-scope-and-access","Access, final, and Immutability — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch23-encapsulation-and-final\u002F23.1-scope-and-access",{"path":698,"title":699,"stem":700},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions","Optional: Avoiding Null Pointer Exceptions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions",{"path":702,"title":703,"stem":704},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F1-what-is-command-based-programming","What Is Command-Based Programming? — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.1-what-is-command-based-programming",{"path":706,"title":707,"stem":708},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F2-commands-and-command-compositions","Commands & Command Compositions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.2-commands-and-command-compositions",{"path":710,"title":711,"stem":712},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F3-the-command-scheduler","The Command Scheduler — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.3-the-command-scheduler",{"path":714,"title":715,"stem":716},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F4-state-machines-logic","State Machines: Logic — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.4-state-machines-logic",{"path":718,"title":719,"stem":720},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F5-managing-transitions","Managing Transitions — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.5-managing-transitions",{"path":722,"title":723,"stem":724},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F6-binding-commands-to-triggers","Binding Commands to Triggers — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.6-binding-commands-to-triggers",{"path":726,"title":727,"stem":728},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F7-structuring-a-command-based-robot-project","Structuring a Command-Based Robot Project — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project",{"path":730,"title":731,"stem":732},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways","Architecture Takeaways — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways",{"path":734,"title":735,"stem":736},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch27-program-design-and-abstraction\u002F1-abstraction-and-program-design","Abstraction and Program Design — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch27-program-design-and-abstraction\u002F27.1-abstraction-and-program-design",{"path":738,"title":739,"stem":740},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F1-searching-algorithms","Searching Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.1-searching-algorithms",{"path":742,"title":743,"stem":744},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F2-sorting-algorithms","Sorting Algorithms — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.2-sorting-algorithms",{"path":746,"title":747,"stem":748},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F3-recursion","Recursion — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.3-recursion",{"path":750,"title":751,"stem":752},"\u002Fshockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F4-recursive-searching-and-sorting","Recursive Searching and Sorting — Worked Example","shockwave-curriculum\u002Fexamples\u002Fch28-algorithms-searching-sorting-recursion\u002F28.4-recursive-searching-and-sorting",[754,758,762,766,770,774,778,782,786,790,794,798,802,806,810,814,818,822,826,830,834,838,842,846,850,854,858,862,866,870,874,878,882,886,890,894,898,902,906,910,914,918,922,926,930,934,938,942,946,950,954,958,962,966,970,974,978,982,986,990,994,998,1002,1006,1010,1014,1018,1022,1026,1030,1034,1038,1042,1046,1050,1054,1058,1062,1066],{"path":755,"title":756,"stem":757},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch01-why-java-for-frc\u002F2-intro-to-algorithms-programming-and-compilers","Intro to Algorithms, Programming and Compilers — Exercises","shockwave-curriculum\u002Fexercises\u002Fch01-why-java-for-frc\u002F1.2-intro-to-algorithms-programming-and-compilers",{"path":759,"title":760,"stem":761},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F1-variables-and-data-types","Variables & Data Types — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.1-variables-and-data-types",{"path":763,"title":764,"stem":765},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2-expressions-and-output","Expressions & Output — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.2-expressions-and-output",{"path":767,"title":768,"stem":769},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F3-assignment-and-input","Assignment & Input — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.3-assignment-and-input",{"path":771,"title":772,"stem":773},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F4-casting-and-ranges-of-values","Casting & Ranges of Values — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.4-casting-and-ranges-of-values",{"path":775,"title":776,"stem":777},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F5-compound-assignment-operators","Compound Assignment Operators — Exercises","shockwave-curriculum\u002Fexercises\u002Fch02-variables-and-types\u002F2.5-compound-assignment-operators",{"path":779,"title":780,"stem":781},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F1-apis-and-libraries","APIs and Libraries — Exercises","shockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3.1-apis-and-libraries",{"path":783,"title":784,"stem":785},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F2-documentation-with-comments-and-preconditions","Documentation with Comments and Preconditions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3.2-documentation-with-comments-and-preconditions",{"path":787,"title":788,"stem":789},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3-packages-and-imports","Packages & Imports — Exercises","shockwave-curriculum\u002Fexercises\u002Fch03-apis-libraries-and-documentation\u002F3.3-packages-and-imports",{"path":791,"title":792,"stem":793},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F1-methods-signatures-and-parameters","Methods, Signatures & Parameters — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.1-methods-signatures-and-parameters",{"path":795,"title":796,"stem":797},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F2-calling-class-methods","Calling Class Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.2-calling-class-methods",{"path":799,"title":800,"stem":801},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F3-using-the-math-class","Using the Math Class — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.3-using-the-math-class",{"path":803,"title":804,"stem":805},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4-objects-instances-of-classes","Objects — Instances of Classes — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.4-objects-instances-of-classes",{"path":807,"title":808,"stem":809},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F5-creating-and-initializing-objects-constructors","Creating & Initializing Objects: Constructors — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.5-creating-and-initializing-objects-constructors",{"path":811,"title":812,"stem":813},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F6-calling-instance-methods","Calling Instance Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch04-using-objects-and-calling-methods\u002F4.6-calling-instance-methods",{"path":815,"title":816,"stem":817},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F1-5.2-if-statements-and-for-loops","if Statements & For Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.1-5.2-if-statements-and-for-loops",{"path":819,"title":820,"stem":821},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F10-nested-iteration","Nested Iteration — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.10-nested-iteration",{"path":823,"title":824,"stem":825},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F11-informal-runtime-analysis-of-loops","Informal Runtime Analysis of Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.11-informal-runtime-analysis-of-loops",{"path":827,"title":828,"stem":829},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F12-switch-statements-and-expressions","switch Statements and Expressions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.12-switch-statements-and-expressions",{"path":831,"title":832,"stem":833},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F3-algorithms-with-selection-and-repetition","Algorithms with Selection and Repetition — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.3-algorithms-with-selection-and-repetition",{"path":835,"title":836,"stem":837},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F4-boolean-expressions","Boolean Expressions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.4-boolean-expressions",{"path":839,"title":840,"stem":841},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5-nested-if-statements","Nested if Statements — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.5-nested-if-statements",{"path":843,"title":844,"stem":845},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F6-compound-boolean-expressions","Compound Boolean Expressions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.6-compound-boolean-expressions",{"path":847,"title":848,"stem":849},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F7-comparing-boolean-expressions-de-morgans-laws","Comparing Boolean Expressions (De Morgan's Laws) — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.7-comparing-boolean-expressions-de-morgans-laws",{"path":851,"title":852,"stem":853},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F8-while-loops","While Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.8-while-loops",{"path":855,"title":856,"stem":857},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F9-implementing-selection-and-iteration-algorithms","Implementing Selection and Iteration Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch05-control-structures\u002F5.9-implementing-selection-and-iteration-algorithms",{"path":859,"title":860,"stem":861},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F1-strings","Strings — Exercises","shockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F6.1-strings",{"path":863,"title":864,"stem":865},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F2-string-algorithms","String Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch06-strings\u002F6.2-string-algorithms",{"path":867,"title":868,"stem":869},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F1-anatomy-of-a-java-class","Anatomy of a Java Class — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.1-anatomy-of-a-java-class",{"path":871,"title":872,"stem":873},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F2-methods-how-to-write-them","Methods: How to Write Them — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.2-methods-how-to-write-them",{"path":875,"title":876,"stem":877},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F3-methods-passing-and-returning-references-of-an-object","Methods: Passing & Returning References of an Object — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.3-methods-passing-and-returning-references-of-an-object",{"path":879,"title":880,"stem":881},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F4-class-static-variables-and-methods","Class (static) Variables & Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch07-the-class-blueprint\u002F7.4-class-static-variables-and-methods",{"path":883,"title":884,"stem":885},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch08-constructors-and-this\u002F1-8.2-constructors-and-this","Constructors & \"this\" — Exercises","shockwave-curriculum\u002Fexercises\u002Fch08-constructors-and-this\u002F8.1-8.2-constructors-and-this",{"path":887,"title":888,"stem":889},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F1-array-creation-and-access","Array Creation and Access — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.1-array-creation-and-access",{"path":891,"title":892,"stem":893},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F2-arraylist-and-its-methods","ArrayList and its Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.2-arraylist-and-its-methods",{"path":895,"title":896,"stem":897},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F3-optional-hashmap-dictionary-data-structure","HashMap (Dictionary) Data Structure — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.3-optional-hashmap-dictionary-data-structure",{"path":899,"title":900,"stem":901},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F4-array-traversals","Array Traversals — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.4-array-traversals",{"path":903,"title":904,"stem":905},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F5-implementing-array-algorithms","Implementing Array Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.5-implementing-array-algorithms",{"path":907,"title":908,"stem":909},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F6-arraylist-traversals","ArrayList Traversals — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.6-arraylist-traversals",{"path":911,"title":912,"stem":913},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F7-implementing-arraylist-algorithms","Implementing ArrayList Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.7-implementing-arraylist-algorithms",{"path":915,"title":916,"stem":917},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F8-using-text-files","Using Text Files — Exercises","shockwave-curriculum\u002Fexercises\u002Fch09-storing-data\u002F9.8-using-text-files",{"path":919,"title":920,"stem":921},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F1-2d-array-creation-and-access","2D Array Creation and Access — Exercises","shockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F10.1-2d-array-creation-and-access",{"path":923,"title":924,"stem":925},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F2-2d-array-traversals-nested-loops","2D Array Traversals: Nested Loops — Exercises","shockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F10.2-2d-array-traversals-nested-loops",{"path":927,"title":928,"stem":929},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F3-implementing-2d-array-algorithms","Implementing 2D Array Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch10-2d-arrays\u002F10.3-implementing-2d-array-algorithms",{"path":931,"title":932,"stem":933},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch11-enums-named-choices\u002F11-enums-named-choices","Enums: Named Choices — Exercises","shockwave-curriculum\u002Fexercises\u002Fch11-enums-named-choices\u002F11-enums-named-choices",{"path":935,"title":936,"stem":937},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch","Exceptions & try\u002Fcatch — Exercises","shockwave-curriculum\u002Fexercises\u002Fch12-exceptions-and-try-catch\u002F12-exceptions-and-try-catch",{"path":939,"title":940,"stem":941},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch13-common-gotchas\u002F13-common-gotchas","Common Gotchas — Exercises","shockwave-curriculum\u002Fexercises\u002Fch13-common-gotchas\u002F13-common-gotchas",{"path":943,"title":944,"stem":945},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch14-why-design-patterns\u002F14-why-design-patterns","Why Design Patterns? — Exercises","shockwave-curriculum\u002Fexercises\u002Fch14-why-design-patterns\u002F14-why-design-patterns",{"path":947,"title":948,"stem":949},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch15-advanced-collections\u002F15-advanced-collections","Advanced Collections (Set\u002FQueue\u002FMap) — Exercises","shockwave-curriculum\u002Fexercises\u002Fch15-advanced-collections\u002F15-advanced-collections",{"path":951,"title":952,"stem":953},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics","Writing Your Own Generics — Exercises","shockwave-curriculum\u002Fexercises\u002Fch16-writing-your-own-generics\u002F16-writing-your-own-generics",{"path":955,"title":956,"stem":957},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F1-inheritance-superclass-subclass","Inheritance, Superclass, Subclass — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.1-inheritance-superclass-subclass",{"path":959,"title":960,"stem":961},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F2-inheritance-and-constructors","Inheritance and Constructors — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.2-inheritance-and-constructors",{"path":963,"title":964,"stem":965},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F3-inheritance-hierarchies","Inheritance Hierarchies — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.3-inheritance-hierarchies",{"path":967,"title":968,"stem":969},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F4-object-superclass","Object Superclass — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.4-object-superclass",{"path":971,"title":972,"stem":973},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F5-abstract-classes-and-methods","Abstract Classes and Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch17-inheritance-and-abstractions\u002F17.5-abstract-classes-and-methods",{"path":975,"title":976,"stem":977},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F1-overriding-methods","Overriding Methods — Exercises","shockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F18.1-overriding-methods",{"path":979,"title":980,"stem":981},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F2-super-keyword","super Keyword — Exercises","shockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F18.2-super-keyword",{"path":983,"title":984,"stem":985},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F3-polymorphism","Polymorphism — Exercises","shockwave-curriculum\u002Fexercises\u002Fch18-polymorphism-many-forms\u002F18.3-polymorphism",{"path":987,"title":988,"stem":989},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts","Interfaces as Contracts — Exercises","shockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F19-interfaces-as-contracts",{"path":991,"title":992,"stem":993},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F1-lambdas-and-method-references","Lambdas & Method References — Exercises","shockwave-curriculum\u002Fexercises\u002Fch19-interfaces-as-contracts\u002F19.1-lambdas-and-method-references",{"path":995,"title":996,"stem":997},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern","The IO-Layer Pattern — Exercises","shockwave-curriculum\u002Fexercises\u002Fch20-the-io-layer-pattern\u002F20-the-io-layer-pattern",{"path":999,"title":1000,"stem":1001},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch21-static-factories\u002F21-static-factories","Static Factories — Exercises","shockwave-curriculum\u002Fexercises\u002Fch21-static-factories\u002F21-static-factories",{"path":1003,"title":1004,"stem":1005},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern","The Builder Pattern — Exercises","shockwave-curriculum\u002Fexercises\u002Fch22-the-builder-pattern\u002F22-the-builder-pattern",{"path":1007,"title":1008,"stem":1009},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch23-encapsulation-and-final\u002F1-scope-and-access","Access, final, and Immutability — Exercises","shockwave-curriculum\u002Fexercises\u002Fch23-encapsulation-and-final\u002F23.1-scope-and-access",{"path":1011,"title":1012,"stem":1013},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions","Optional: Avoiding Null Pointer Exceptions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch24-optional-avoiding-null-pointer-exceptions\u002F24-optional-avoiding-null-pointer-exceptions",{"path":1015,"title":1016,"stem":1017},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F1-what-is-command-based-programming","What Is Command-Based Programming? — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.1-what-is-command-based-programming",{"path":1019,"title":1020,"stem":1021},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F2-commands-and-command-compositions","Commands & Command Compositions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.2-commands-and-command-compositions",{"path":1023,"title":1024,"stem":1025},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F3-the-command-scheduler","The Command Scheduler — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.3-the-command-scheduler",{"path":1027,"title":1028,"stem":1029},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F4-state-machines-logic","State Machines: Logic — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.4-state-machines-logic",{"path":1031,"title":1032,"stem":1033},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F5-managing-transitions","Managing Transitions — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.5-managing-transitions",{"path":1035,"title":1036,"stem":1037},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F6-binding-commands-to-triggers","Binding Commands to Triggers — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.6-binding-commands-to-triggers",{"path":1039,"title":1040,"stem":1041},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F7-structuring-a-command-based-robot-project","Structuring a Command-Based Robot Project — Exercises","shockwave-curriculum\u002Fexercises\u002Fch25-command-based-programming\u002F25.7-structuring-a-command-based-robot-project",{"path":1043,"title":1044,"stem":1045},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways","Architecture Takeaways — Exercises","shockwave-curriculum\u002Fexercises\u002Fch26-architecture-takeaways\u002F26-architecture-takeaways",{"path":1047,"title":1048,"stem":1049},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F1-abstraction-and-program-design","Abstraction and Program Design — Exercises","shockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F27.1-abstraction-and-program-design",{"path":1051,"title":1052,"stem":1053},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F2-impact-of-program-design","Impact of Program Design — Exercises","shockwave-curriculum\u002Fexercises\u002Fch27-program-design-and-abstraction\u002F27.2-impact-of-program-design",{"path":1055,"title":1056,"stem":1057},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F1-searching-algorithms","Searching Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.1-searching-algorithms",{"path":1059,"title":1060,"stem":1061},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F2-sorting-algorithms","Sorting Algorithms — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.2-sorting-algorithms",{"path":1063,"title":1064,"stem":1065},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F3-recursion","Recursion — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.3-recursion",{"path":1067,"title":1068,"stem":1069},"\u002Fshockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F4-recursive-searching-and-sorting","Recursive Searching and Sorting — Exercises","shockwave-curriculum\u002Fexercises\u002Fch28-algorithms-searching-sorting-recursion\u002F28.4-recursive-searching-and-sorting",{"id":1071,"title":202,"body":1072,"description":2268,"extension":2269,"meta":2270,"navigation":1466,"path":201,"seo":2273,"stem":203,"__hash__":2274},"lessons\u002Fshockwave-curriculum\u002Flessons\u002Fch15-advanced-collections\u002F15-advanced-collections.md",{"type":1073,"value":1074,"toc":2259},"minimark",[1075,1079,1117,1160,1165,1179,1208,1214,1264,1275,1292,1351,1355,1364,1442,1492,1532,1536,1551,1629,1632,1666,1727,1731,1780,1822,1867,1901,1930,1934,1960,1980,1995,1999,2114,2118,2235,2255],[1076,1077,202],"h1",{"id":1078},"advanced-collections-setqueuemap",[1080,1081,1082,1083,1087,1088,1091,1092,1098,1099,1104,1105,1110,1111,1116],"p",{},"Ch.9 covered ",[1084,1085,1086],"code",{},"ArrayList"," and a basic ",[1084,1089,1090],{},"HashMap",". Three more collection types round out the toolbox, each solving a problem the others don't: ",[1093,1094,1095],"strong",{},[1084,1096,1097],{},"Set"," (no duplicates, ever), ",[1093,1100,1101],{},[1084,1102,1103],{},"Queue","\u002F",[1093,1106,1107],{},[1084,1108,1109],{},"Deque"," (order of processing matters more than random access), and a deeper look at ",[1093,1112,1113],{},[1084,1114,1115],{},"Map"," (iterating both keys and values together, and choosing an ordering).",[1080,1118,1119,1120,1122,1123,1126,1127,1129,1130,1129,1132,1134,1135,1137,1138,1141,1142,1145,1146,1129,1149,1152,1153,1104,1155,1104,1157,1159],{},"Quick vocabulary note before diving in: just like ",[1084,1121,1086],{}," (Ch.9) is really an implementation of the ",[1084,1124,1125],{},"List"," interface, ",[1084,1128,1097],{},", ",[1084,1131,1103],{},[1084,1133,1109],{},", and ",[1084,1136,1115],{}," are themselves ",[1093,1139,1140],{},"interfaces",", not classes — you never write ",[1084,1143,1144],{},"new Set\u003CInteger>()"," (that doesn't compile), only ",[1084,1147,1148],{},"new HashSet\u003CInteger>()",[1084,1150,1151],{},"new TreeSet\u003CInteger>()",", and so on, stored in a variable declared by the interface type. Ch.19 covers what an interface actually is; for now, read ",[1084,1154,1097],{},[1084,1156,1103],{},[1084,1158,1115],{}," as \"the name for a family of collection classes that all support this common set of operations.\"",[1161,1162,1164],"h2",{"id":1163},"set-no-duplicates-ever","Set: No Duplicates, Ever",[1080,1166,1167,1168,1170,1171,1174,1175,1178],{},"A ",[1084,1169,1097],{}," is a collection that flatly refuses duplicate elements — calling ",[1084,1172,1173],{},"add"," with something already present just does nothing (and returns ",[1084,1176,1177],{},"false","), rather than adding a second copy:",[1180,1181,1186],"pre",{"className":1182,"code":1183,"language":1184,"meta":1185,"style":1185},"language-java shiki shiki-themes github-light github-dark","Set\u003CInteger> usedCanIds = new HashSet\u003CInteger>();\nusedCanIds.add(5);  \u002F\u002F true — added\nusedCanIds.add(5);  \u002F\u002F false — already present, nothing changed\n","java","",[1084,1187,1188,1196,1202],{"__ignoreMap":1185},[1189,1190,1193],"span",{"class":1191,"line":1192},"line",1,[1189,1194,1195],{},"Set\u003CInteger> usedCanIds = new HashSet\u003CInteger>();\n",[1189,1197,1199],{"class":1191,"line":1198},2,[1189,1200,1201],{},"usedCanIds.add(5);  \u002F\u002F true — added\n",[1189,1203,1205],{"class":1191,"line":1204},3,[1189,1206,1207],{},"usedCanIds.add(5);  \u002F\u002F false — already present, nothing changed\n",[1080,1209,1210,1211,1213],{},"That makes ",[1084,1212,1097],{}," the natural tool for catching configuration conflicts — e.g. verifying no two devices on the robot were accidentally wired to the same CAN ID:",[1180,1215,1217],{"className":1182,"code":1216,"language":1184,"meta":1185,"style":1185},"Set\u003CInteger> seenIds = new HashSet\u003CInteger>();\nfor (int id : allConfiguredCanIds)\n{\n    if (!seenIds.add(id)) \u002F\u002F add() returns false if it was already there\n    {\n        reportWarning(\"Duplicate CAN ID detected: \" + id);\n    }\n}\n",[1084,1218,1219,1224,1229,1234,1240,1246,1252,1258],{"__ignoreMap":1185},[1189,1220,1221],{"class":1191,"line":1192},[1189,1222,1223],{},"Set\u003CInteger> seenIds = new HashSet\u003CInteger>();\n",[1189,1225,1226],{"class":1191,"line":1198},[1189,1227,1228],{},"for (int id : allConfiguredCanIds)\n",[1189,1230,1231],{"class":1191,"line":1204},[1189,1232,1233],{},"{\n",[1189,1235,1237],{"class":1191,"line":1236},4,[1189,1238,1239],{},"    if (!seenIds.add(id)) \u002F\u002F add() returns false if it was already there\n",[1189,1241,1243],{"class":1191,"line":1242},5,[1189,1244,1245],{},"    {\n",[1189,1247,1249],{"class":1191,"line":1248},6,[1189,1250,1251],{},"        reportWarning(\"Duplicate CAN ID detected: \" + id);\n",[1189,1253,1255],{"class":1191,"line":1254},7,[1189,1256,1257],{},"    }\n",[1189,1259,1261],{"class":1191,"line":1260},8,[1189,1262,1263],{},"}\n",[1080,1265,1266,1267,1270,1271,1274],{},"(",[1084,1268,1269],{},"allConfiguredCanIds"," and ",[1084,1272,1273],{},"reportWarning"," stand in for this team's own array and logging method — this snippet is a fragment, not a complete program.)",[1080,1276,1277,1280,1281,1284,1285,1288,1289,1291],{},[1084,1278,1279],{},"HashSet"," (fastest, no ordering guarantee) is the usual default; ",[1084,1282,1283],{},"LinkedHashSet"," remembers insertion order; ",[1084,1286,1287],{},"TreeSet"," keeps elements sorted. All three still refuse duplicates — they mainly differ in iteration order (and, for ",[1084,1290,1287],{},", in one extra requirement covered in the pitfalls below).",[1080,1293,1294,1296,1297,1300,1301,1304,1305,1308,1309,1312,1313,1316,1317,1320,1321,1323,1324,1104,1327,1104,1330,1333,1334,1340,1341,1344,1345,1347,1348],{},[1084,1295,1097],{}," also supports set algebra directly as methods: ",[1084,1298,1299],{},"s1.containsAll(s2)"," (is ",[1084,1302,1303],{},"s2"," a subset of ",[1084,1306,1307],{},"s1","?), ",[1084,1310,1311],{},"s1.addAll(s2)"," (union), ",[1084,1314,1315],{},"s1.retainAll(s2)"," (intersection — keep only what's in both), ",[1084,1318,1319],{},"s1.removeAll(s2)"," (difference — remove anything also in ",[1084,1322,1303],{},"). All three of ",[1084,1325,1326],{},"addAll",[1084,1328,1329],{},"retainAll",[1084,1331,1332],{},"removeAll"," ",[1093,1335,1336,1337,1339],{},"change ",[1084,1338,1307],{}," in place"," and return a ",[1084,1342,1343],{},"boolean"," (whether ",[1084,1346,1307],{}," actually changed) — none of them returns a new set. To keep the originals untouched, copy first: ",[1084,1349,1350],{},"Set\u003CInteger> intersection = new HashSet\u003CInteger>(s1); intersection.retainAll(s2);",[1161,1352,1354],{"id":1353},"queue-first-in-first-out","Queue: First-In, First-Out",[1080,1356,1167,1357,1359,1360,1363],{},[1084,1358,1103],{}," holds elements for later processing, normally in ",[1093,1361,1362],{},"FIFO"," order (first-in-first-out) — think of a queue of autonomous routine steps waiting to run in the order they were scheduled. Every operation comes in two flavors: one throws an exception on failure, the other returns a safe placeholder value instead.",[1365,1366,1367,1383],"table",{},[1368,1369,1370],"thead",{},[1371,1372,1373,1377,1380],"tr",{},[1374,1375,1376],"th",{},"Operation",[1374,1378,1379],{},"Throws on failure",[1374,1381,1382],{},"Returns a placeholder",[1384,1385,1386,1406,1425],"tbody",{},[1371,1387,1388,1392,1397],{},[1389,1390,1391],"td",{},"Insert",[1389,1393,1394],{},[1084,1395,1396],{},"add(e)",[1389,1398,1399,1402,1403,1405],{},[1084,1400,1401],{},"offer(e)"," (returns ",[1084,1404,1177],{},")",[1371,1407,1408,1411,1416],{},[1389,1409,1410],{},"Remove",[1389,1412,1413],{},[1084,1414,1415],{},"remove()",[1389,1417,1418,1402,1421,1424],{},[1084,1419,1420],{},"poll()",[1084,1422,1423],{},"null"," if empty)",[1371,1426,1427,1430,1435],{},[1389,1428,1429],{},"Peek (don't remove)",[1389,1431,1432],{},[1084,1433,1434],{},"element()",[1389,1436,1437,1402,1440,1424],{},[1084,1438,1439],{},"peek()",[1084,1441,1423],{},[1180,1443,1445],{"className":1182,"code":1444,"language":1184,"meta":1185,"style":1185},"Queue\u003CString> pendingFaults = new LinkedList\u003CString>();\npendingFaults.add(\"Camera 1 disconnected\");\npendingFaults.add(\"Low battery voltage\");\n\nwhile (!pendingFaults.isEmpty())\n{\n    \u002F\u002F poll() removes and returns the oldest fault first\n    System.out.println(\"Handling: \" + pendingFaults.poll());\n}\n",[1084,1446,1447,1452,1457,1462,1468,1473,1477,1482,1487],{"__ignoreMap":1185},[1189,1448,1449],{"class":1191,"line":1192},[1189,1450,1451],{},"Queue\u003CString> pendingFaults = new LinkedList\u003CString>();\n",[1189,1453,1454],{"class":1191,"line":1198},[1189,1455,1456],{},"pendingFaults.add(\"Camera 1 disconnected\");\n",[1189,1458,1459],{"class":1191,"line":1204},[1189,1460,1461],{},"pendingFaults.add(\"Low battery voltage\");\n",[1189,1463,1464],{"class":1191,"line":1236},[1189,1465,1467],{"emptyLinePlaceholder":1466},true,"\n",[1189,1469,1470],{"class":1191,"line":1242},[1189,1471,1472],{},"while (!pendingFaults.isEmpty())\n",[1189,1474,1475],{"class":1191,"line":1248},[1189,1476,1233],{},[1189,1478,1479],{"class":1191,"line":1254},[1189,1480,1481],{},"    \u002F\u002F poll() removes and returns the oldest fault first\n",[1189,1483,1484],{"class":1191,"line":1260},[1189,1485,1486],{},"    System.out.println(\"Handling: \" + pendingFaults.poll());\n",[1189,1488,1490],{"class":1191,"line":1489},9,[1189,1491,1263],{},[1080,1493,1494,1104,1496,1498,1499,1501,1502,1505,1506,1509,1510,1513,1514,1516,1517,1519,1520,1523,1524,1527,1528,1531],{},[1084,1495,1420],{},[1084,1497,1439],{}," are usually the safer default in real code — they hand back ",[1084,1500,1423],{}," instead of throwing when the queue happens to be empty, which is often a completely normal state (no faults right now) rather than an error. Watch out with a ",[1084,1503,1504],{},"Queue\u003CInteger>"," (or any primitive wrapper) though: ",[1084,1507,1508],{},"int x = intQueue.poll();"," on an empty queue throws ",[1084,1511,1512],{},"NullPointerException",", because assigning ",[1084,1515,1420],{},"'s ",[1084,1518,1423],{}," into a primitive ",[1084,1521,1522],{},"int"," unboxes it immediately (Ch.9.2). Check ",[1084,1525,1526],{},"isEmpty()"," first, or keep the result as ",[1084,1529,1530],{},"Integer"," instead of unboxing right away.",[1161,1533,1535],{"id":1534},"deque-both-ends-at-once","Deque: Both Ends at Once",[1080,1537,1167,1538,1542,1543,1547,1548,1550],{},[1093,1539,1540],{},[1084,1541,1109],{}," (\"deck,\" double-ended queue) supports inserting and removing from ",[1544,1545,1546],"em",{},"either"," end, which means a single ",[1084,1549,1109],{}," can act as a FIFO queue, a LIFO stack, or both:",[1365,1552,1553,1565],{},[1368,1554,1555],{},[1371,1556,1557,1559,1562],{},[1374,1558,1376],{},[1374,1560,1561],{},"First (front)",[1374,1563,1564],{},"Last (back)",[1384,1566,1567,1588,1608],{},[1371,1568,1569,1571,1580],{},[1389,1570,1391],{},[1389,1572,1573,1576,1577],{},[1084,1574,1575],{},"addFirst(e)"," \u002F ",[1084,1578,1579],{},"offerFirst(e)",[1389,1581,1582,1576,1585],{},[1084,1583,1584],{},"addLast(e)",[1084,1586,1587],{},"offerLast(e)",[1371,1589,1590,1592,1600],{},[1389,1591,1410],{},[1389,1593,1594,1576,1597],{},[1084,1595,1596],{},"removeFirst()",[1084,1598,1599],{},"pollFirst()",[1389,1601,1602,1576,1605],{},[1084,1603,1604],{},"removeLast()",[1084,1606,1607],{},"pollLast()",[1371,1609,1610,1613,1621],{},[1389,1611,1612],{},"Examine",[1389,1614,1615,1576,1618],{},[1084,1616,1617],{},"getFirst()",[1084,1619,1620],{},"peekFirst()",[1389,1622,1623,1576,1626],{},[1084,1624,1625],{},"getLast()",[1084,1627,1628],{},"peekLast()",[1080,1630,1631],{},"A common use: an undo stack for the last few climb-sequence steps, where you only ever add\u002Fremove from one end (LIFO — last one added is the first one undone):",[1180,1633,1635],{"className":1182,"code":1634,"language":1184,"meta":1185,"style":1185},"Deque\u003CString> climbSteps = new ArrayDeque\u003CString>();\nclimbSteps.addLast(\"Extend to high bar\");\nclimbSteps.addLast(\"Release from mid bar\");\n\n\u002F\u002F \"Release from mid bar\" — undo the most recent step\nString lastStep = climbSteps.removeLast();\n",[1084,1636,1637,1642,1647,1652,1656,1661],{"__ignoreMap":1185},[1189,1638,1639],{"class":1191,"line":1192},[1189,1640,1641],{},"Deque\u003CString> climbSteps = new ArrayDeque\u003CString>();\n",[1189,1643,1644],{"class":1191,"line":1198},[1189,1645,1646],{},"climbSteps.addLast(\"Extend to high bar\");\n",[1189,1648,1649],{"class":1191,"line":1204},[1189,1650,1651],{},"climbSteps.addLast(\"Release from mid bar\");\n",[1189,1653,1654],{"class":1191,"line":1236},[1189,1655,1467],{"emptyLinePlaceholder":1466},[1189,1657,1658],{"class":1191,"line":1242},[1189,1659,1660],{},"\u002F\u002F \"Release from mid bar\" — undo the most recent step\n",[1189,1662,1663],{"class":1191,"line":1248},[1189,1664,1665],{},"String lastStep = climbSteps.removeLast();\n",[1080,1667,1668,1671,1672,1674,1675,1678,1679,1681,1682,1104,1685,1104,1688,1690,1691,1694,1695,1129,1698,1694,1701,1704,1705,1707,1708,1711,1712,1715,1716,1719,1720,1722,1723,1726],{},[1084,1669,1670],{},"ArrayDeque"," is the standard general-purpose ",[1084,1673,1109],{}," implementation — generally faster than ",[1084,1676,1677],{},"LinkedList"," for this purpose, with no capacity limit. A ",[1084,1680,1109],{}," also has stack-flavored ",[1084,1683,1684],{},"push(e)",[1084,1686,1687],{},"pop()",[1084,1689,1439],{}," methods, which just work on the front (",[1084,1692,1693],{},"push"," = ",[1084,1696,1697],{},"addFirst",[1084,1699,1700],{},"pop",[1084,1702,1703],{},"removeFirst","). Prefer ",[1084,1706,1670],{}," over the old ",[1084,1709,1710],{},"java.util.Stack"," class — ",[1084,1713,1714],{},"Stack"," is a legacy holdover with locking overhead this course never needs. (A ",[1084,1717,1718],{},"PriorityQueue"," is a different ",[1084,1721,1103],{}," implementation worth knowing the name of: it always polls back the ",[1544,1724,1725],{},"smallest"," element first, rather than the oldest — outside what this lesson covers.)",[1161,1728,1730],{"id":1729},"map-revisited-iterating-both-keys-and-values","Map, Revisited: Iterating Both Keys and Values",[1080,1732,1733,1734,1104,1737,1129,1740,1104,1743,1104,1746,1104,1749,1752,1753,1756,1757,1760,1761,1764,1765,1768,1769,1772,1773,1270,1776,1779],{},"Ch.9.3 covered ",[1084,1735,1736],{},"put",[1084,1738,1739],{},"get",[1084,1741,1742],{},"containsKey",[1084,1744,1745],{},"getOrDefault",[1084,1747,1748],{},"remove",[1084,1750,1751],{},"size",", and looping over ",[1084,1754,1755],{},"keySet()"," — all of that still applies here. ",[1084,1758,1759],{},"Map.entrySet()"," gives every key ",[1544,1762,1763],{},"and"," value together in one pass, avoiding a repeated ",[1084,1766,1767],{},"get()"," call for each key. Each item it hands back is a ",[1084,1770,1771],{},"Map.Entry\u003CK, V>"," — a small read-only key\u002Fvalue pair object, with ",[1084,1774,1775],{},"getKey()",[1084,1777,1778],{},"getValue()",":",[1180,1781,1783],{"className":1182,"code":1782,"language":1184,"meta":1185,"style":1185},"Map\u003CInteger, Double> motorOffsets = new HashMap\u003CInteger, Double>();\nmotorOffsets.put(5, 0.02);\nmotorOffsets.put(6, -0.01);\n\nfor (Map.Entry\u003CInteger, Double> entry : motorOffsets.entrySet())\n{\n    System.out.println(\"CAN ID \" + entry.getKey() + \" -> offset \" + entry.getValue());\n}\n",[1084,1784,1785,1790,1795,1800,1804,1809,1813,1818],{"__ignoreMap":1185},[1189,1786,1787],{"class":1191,"line":1192},[1189,1788,1789],{},"Map\u003CInteger, Double> motorOffsets = new HashMap\u003CInteger, Double>();\n",[1189,1791,1792],{"class":1191,"line":1198},[1189,1793,1794],{},"motorOffsets.put(5, 0.02);\n",[1189,1796,1797],{"class":1191,"line":1204},[1189,1798,1799],{},"motorOffsets.put(6, -0.01);\n",[1189,1801,1802],{"class":1191,"line":1236},[1189,1803,1467],{"emptyLinePlaceholder":1466},[1189,1805,1806],{"class":1191,"line":1242},[1189,1807,1808],{},"for (Map.Entry\u003CInteger, Double> entry : motorOffsets.entrySet())\n",[1189,1810,1811],{"class":1191,"line":1248},[1189,1812,1233],{},[1189,1814,1815],{"class":1191,"line":1254},[1189,1816,1817],{},"    System.out.println(\"CAN ID \" + entry.getKey() + \" -> offset \" + entry.getValue());\n",[1189,1819,1820],{"class":1191,"line":1260},[1189,1821,1263],{},[1080,1823,1824,1825,1827,1828,1830,1831,1834,1835,1838,1839,1841,1842,1845,1846,1848,1849,1841,1851,1854,1855,1857,1858,1860,1861,1863,1864,1866],{},"Just like ",[1084,1826,1097],{},", a plain ",[1084,1829,1090],{}," gives no ordering guarantee. Swapping the implementation type is enough to change that, with no other code changes needed to the lines that ",[1544,1832,1833],{},"use"," the map — but a copy constructor only ever preserves the ",[1544,1836,1837],{},"source"," map's own iteration order. Copying a ",[1084,1840,1090],{}," into a ",[1084,1843,1844],{},"TreeMap"," is fine, because a ",[1084,1847,1844],{}," re-sorts by key regardless of where the entries came from. Copying a ",[1084,1850,1090],{},[1084,1852,1853],{},"LinkedHashMap",", though, just keeps the ",[1084,1856,1090],{},"'s unpredictable order — the original ",[1084,1859,1736],{}," order was never recorded anywhere, so there's nothing to preserve. To actually get insertion order, build the ",[1084,1862,1853],{}," from empty and ",[1084,1865,1736],{}," into it directly:",[1180,1868,1870],{"className":1182,"code":1869,"language":1184,"meta":1185,"style":1185},"\u002F\u002F sorted by key — copying in is fine here, TreeMap always re-sorts\nMap\u003CInteger, Double> sorted = new TreeMap\u003CInteger, Double>(motorOffsets);\n\nMap\u003CInteger, Double> byInsertOrder = new LinkedHashMap\u003CInteger, Double>();\nbyInsertOrder.put(5, 0.02);\nbyInsertOrder.put(6, -0.01); \u002F\u002F LinkedHashMap remembers put order, starting from empty\n",[1084,1871,1872,1877,1882,1886,1891,1896],{"__ignoreMap":1185},[1189,1873,1874],{"class":1191,"line":1192},[1189,1875,1876],{},"\u002F\u002F sorted by key — copying in is fine here, TreeMap always re-sorts\n",[1189,1878,1879],{"class":1191,"line":1198},[1189,1880,1881],{},"Map\u003CInteger, Double> sorted = new TreeMap\u003CInteger, Double>(motorOffsets);\n",[1189,1883,1884],{"class":1191,"line":1204},[1189,1885,1467],{"emptyLinePlaceholder":1466},[1189,1887,1888],{"class":1191,"line":1236},[1189,1889,1890],{},"Map\u003CInteger, Double> byInsertOrder = new LinkedHashMap\u003CInteger, Double>();\n",[1189,1892,1893],{"class":1191,"line":1242},[1189,1894,1895],{},"byInsertOrder.put(5, 0.02);\n",[1189,1897,1898],{"class":1191,"line":1248},[1189,1899,1900],{},"byInsertOrder.put(6, -0.01); \u002F\u002F LinkedHashMap remembers put order, starting from empty\n",[1080,1902,1903,1904,1129,1907,1129,1910,1129,1913,1916,1917,1129,1919,1129,1921,1129,1923,1925,1926,1929],{},"This is the payoff of always declaring a variable by its interface type (",[1084,1905,1906],{},"List\u003CE>",[1084,1908,1909],{},"Map\u003CK, V>",[1084,1911,1912],{},"Set\u003CE>",[1084,1914,1915],{},"Queue\u003CE>",") rather than its concrete implementation (",[1084,1918,1086],{},[1084,1920,1090],{},[1084,1922,1279],{},[1084,1924,1677],{},") — changing which concrete class gets constructed is a one-line change, because every line that ",[1544,1927,1928],{},"uses"," the collection only ever depends on the interface.",[1161,1931,1933],{"id":1932},"fixed-collections-listof-setof-mapof","Fixed Collections: List.of, Set.of, Map.of",[1080,1935,1936,1937,1129,1940,1134,1943,1946,1947,1950,1951,1954,1955,1104,1957,1959],{},"For data that's fixed once created — a small lookup table, a set of valid states — ",[1084,1938,1939],{},"List.of(...)",[1084,1941,1942],{},"Set.of(...)",[1084,1944,1945],{},"Map.of(...)"," build an ",[1093,1948,1949],{},"immutable"," collection in one line, with no ",[1084,1952,1953],{},"new"," and no separate ",[1084,1956,1173],{},[1084,1958,1736],{}," calls:",[1180,1961,1963],{"className":1182,"code":1962,"language":1184,"meta":1185,"style":1185},"List\u003CString> allianceColors = List.of(\"Red\", \"Blue\");\nSet\u003CInteger> validPracticeFields = Set.of(1, 2, 3);\nMap\u003CString, Integer> startingSlots = Map.of(\"Left\", 1, \"Center\", 2, \"Right\", 3);\n",[1084,1964,1965,1970,1975],{"__ignoreMap":1185},[1189,1966,1967],{"class":1191,"line":1192},[1189,1968,1969],{},"List\u003CString> allianceColors = List.of(\"Red\", \"Blue\");\n",[1189,1971,1972],{"class":1191,"line":1198},[1189,1973,1974],{},"Set\u003CInteger> validPracticeFields = Set.of(1, 2, 3);\n",[1189,1976,1977],{"class":1191,"line":1204},[1189,1978,1979],{},"Map\u003CString, Integer> startingSlots = Map.of(\"Left\", 1, \"Center\", 2, \"Right\", 3);\n",[1080,1981,1982,1983,1129,1985,1987,1988,1990,1991,1994],{},"Calling ",[1084,1984,1173],{},[1084,1986,1736],{},", or ",[1084,1989,1748],{}," on any of these throws ",[1084,1992,1993],{},"UnsupportedOperationException"," — they're meant to be built once and only read afterward.",[1161,1996,1998],{"id":1997},"common-pitfalls","Common Pitfalls",[2000,2001,2002,2025,2041,2061,2079],"ul",{},[2003,2004,2005,2014,2015,1104,2017,2019,2020,1104,2022,2024],"li",{},[1093,2006,2007,2008,2010,2011,2013],{},"Assuming a ",[1084,2009,1279],{}," or ",[1084,2012,1090],{}," remembers insertion order."," Neither does — reach for ",[1084,2016,1283],{},[1084,2018,1853],{}," if insertion order actually matters, or ",[1084,2021,1287],{},[1084,2023,1844],{}," if sorted order does.",[2003,2026,2027,2035,2036,1104,2038,2040],{},[1093,2028,2029,2030,1104,2032,2034],{},"Using ",[1084,2031,1415],{},[1084,2033,1434],{}," on a queue that might be empty."," Both throw when empty — prefer ",[1084,2037,1420],{},[1084,2039,1439],{}," unless an empty queue genuinely represents a bug that should crash loudly.",[2003,2042,2043,1333,2046,2049,2050,2053,2054,2056,2057,2060],{},[1093,2044,2045],{},"Declaring a collection variable by its concrete type instead of its interface.",[1084,2047,2048],{},"HashMap\u003CK,V> m = new HashMap\u003CK,V>();"," locks every line that touches ",[1084,2051,2052],{},"m"," to ",[1084,2055,1090],{},"'s specific behavior — declare it ",[1084,2058,2059],{},"Map\u003CK,V> m = new HashMap\u003CK,V>();"," instead, so the implementation can change later without touching anything else.",[2003,2062,2063,2078],{},[1093,2064,2065,2066,1104,2068,2070,2071,1270,2074,2077],{},"Putting your own class into a ",[1084,2067,1279],{},[1084,2069,1090],{}," without overriding both ",[1084,2072,2073],{},"equals",[1084,2075,2076],{},"hashCode","."," Two objects that \"look equal\" still count as different keys\u002Felements unless both methods are overridden together — covered in full in Lesson 17.4.",[2003,2080,2081,2088,2089,2092,2093,1104,2096,2099,2100,1104,2102,2104,2105,1129,2107,1129,2110,2113],{},[1093,2082,2065,2083,1104,2085,2087],{},[1084,2084,1287],{},[1084,2086,1844],{}," without teaching Java how to compare it."," Both need elements\u002Fkeys that can be compared to each other; a class with no defined ordering throws ",[1084,2090,2091],{},"ClassCastException"," the first time one gets added. ",[1084,2094,2095],{},"Comparable",[1084,2097,2098],{},"Comparator",", the tools for that, are covered in Ch.19 — until then, only use ",[1084,2101,1287],{},[1084,2103,1844],{}," with types Java already knows how to order (",[1084,2106,1530],{},[1084,2108,2109],{},"String",[1084,2111,2112],{},"Double",", ...).",[1161,2115,2117],{"id":2116},"key-takeaways","Key Takeaways",[2000,2119,2120,2152,2166,2189,2204,2220,2232],{},[2003,2121,2122,1129,2124,1129,2126,1129,2128,1134,2130,2132,2133,1129,2135,1104,2137,1104,2139,1129,2141,1104,2143,1134,2145,1104,2147,1104,2149,2151],{},[1084,2123,1125],{},[1084,2125,1097],{},[1084,2127,1103],{},[1084,2129,1109],{},[1084,2131,1115],{}," are interfaces, not classes — ",[1084,2134,1086],{},[1084,2136,1279],{},[1084,2138,1287],{},[1084,2140,1283],{},[1084,2142,1677],{},[1084,2144,1670],{},[1084,2146,1090],{},[1084,2148,1844],{},[1084,2150,1853],{}," are the classes that implement them (Ch.19 covers interfaces in full).",[2003,2153,2154,2156,2157,2159,2160,2162,2163,2165],{},[1084,2155,1097],{}," guarantees no duplicates; ",[1084,2158,1279],{}," is fastest with no ordering, ",[1084,2161,1283],{}," keeps insertion order, ",[1084,2164,1287],{}," keeps sorted order (and needs comparable elements).",[2003,2167,2168,2170,2171,1104,2173,1104,2175,2178,2179,1104,2182,1104,2185,2188],{},[1084,2169,1103],{}," processes elements FIFO by default; every operation has a throwing form (",[1084,2172,1173],{},[1084,2174,1748],{},[1084,2176,2177],{},"element",") and a safe form (",[1084,2180,2181],{},"offer",[1084,2183,2184],{},"poll",[1084,2186,2187],{},"peek",") that returns a placeholder instead of throwing.",[2003,2190,2191,2193,2194,1104,2196,1104,2198,2200,2201,2203],{},[1084,2192,1109],{}," supports both ends at once, letting one type serve as either a queue or a stack (",[1084,2195,1693],{},[1084,2197,1700],{},[1084,2199,2187],{},"); ",[1084,2202,1670],{}," is the standard general-purpose implementation.",[2003,2205,2206,2208,2209,2212,2213,2216,2217,2219],{},[1084,2207,1759],{}," iterates keys and values together as ",[1084,2210,2211],{},"Map.Entry"," pairs; a copy constructor only preserves the ",[1544,2214,2215],{},"source's"," iteration order, so build a ",[1084,2218,1853],{}," from empty to get true insertion order.",[2003,2221,2222,1104,2225,1104,2228,2231],{},[1084,2223,2224],{},"List.of",[1084,2226,2227],{},"Set.of",[1084,2229,2230],{},"Map.of"," build small, fixed, immutable collections in one line.",[2003,2233,2234],{},"Always declare collection variables by their interface type, not their concrete implementation — it's what makes swapping implementations a one-line change.",[1080,2236,2237,2238,2241,2242,1129,2245,1129,2248,1129,2251,2254],{},"Derived from ",[1084,2239,2240],{},"other-reference-repo",": ",[1084,2243,2244],{},"oracle-java-tutorials\u002Fcollections-interfaces\u002F01-the-set-interface.md",[1084,2246,2247],{},"02-the-queue-interface.md",[1084,2249,2250],{},"03-the-deque-interface.md",[1084,2252,2253],{},"04-the-map-interface.md"," (ORACLE 13.1-4)",[2256,2257,2258],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":1185,"searchDepth":1198,"depth":1198,"links":2260},[2261,2262,2263,2264,2265,2266,2267],{"id":1163,"depth":1198,"text":1164},{"id":1353,"depth":1198,"text":1354},{"id":1534,"depth":1198,"text":1535},{"id":1729,"depth":1198,"text":1730},{"id":1932,"depth":1198,"text":1933},{"id":1997,"depth":1198,"text":1998},{"id":2116,"depth":1198,"text":2117},"Ch.9 covered ArrayList and a basic HashMap. Three more collection types round out the toolbox, each solving a problem the others don't: Set (no duplicates, ever), Queue\u002FDeque (order of processing matters more than random access), and a deeper look at Map (iterating both keys and values together, and choosing an ordering).","md",{"outlineRef":2271,"status":2272},"15 — Advanced Collections (Set\u002FQueue\u002FMap) (ORACLE 13.1-4)","new — authored lesson",{"title":202,"description":2268},"lqvGgznmLjsbQE9jNTeDC0TREMXtwbvGnk5Km3KT_BE",{"id":2276,"title":635,"body":2277,"description":1185,"extension":2269,"meta":2827,"navigation":1466,"path":634,"seo":2830,"stem":636,"__hash__":2831},"examples\u002Fshockwave-curriculum\u002Fexamples\u002Fch15-advanced-collections\u002F15-advanced-collections.md",{"type":1073,"value":2278,"toc":2816},[2279,2282,2286,2289,2305,2309,2340,2343,2354,2360,2434,2437,2445,2465,2468,2491,2493,2499,2519,2525,2595,2597,2603,2611,2614,2623,2630,2638,2643,2687,2702,2730,2732,2738,2748,2752,2814],[1076,2280,635],{"id":2281},"advanced-collections-setqueuemap-worked-example",[1161,2283,2285],{"id":2284},"problem","Problem",[1080,2287,2288],{},"At an event, the team's scouting tablets need to sync up before alliance selection. Three separate jobs:",[2290,2291,2292,2299,2302],"ol",{},[2003,2293,2294,2295,2298],{},"Scouts sometimes cover the same team twice. From the list of team numbers scouted so far, flag every repeat, count how many ",[1544,2296,2297],{},"different"," teams were scouted, and print them in numeric order.",[2003,2300,2301],{},"Match reports are waiting to upload. Upload them in the order they were saved, oldest first.",[2003,2303,2304],{},"Each team's best auto score has been recorded. Print every team with its score, sorted by team number.",[1161,2306,2308],{"id":2307},"step-1-plan-it-first","Step 1: Plan It First",[2290,2310,2311,2320,2325],{},[2003,2312,2313,2314,2316,2317,2319],{},"\"No repeats\" plus \"numeric order\" means a ",[1084,2315,1097],{},". Specifically a ",[1084,2318,1287],{},", since the output should be sorted.",[2003,2321,2322,2323,2077],{},"\"Oldest first\" is first-in, first-out, so this is a ",[1084,2324,1103],{},[2003,2326,2327,2328,2330,2331,2333,2334,2337,2338,2077],{},"Team number → score is a key\u002Fvalue lookup, so this is a ",[1084,2329,1115],{},". Printing keys ",[1544,2332,1763],{}," values together means ",[1084,2335,2336],{},"entrySet()",". Sorted by key means a ",[1084,2339,1844],{},[1080,2341,2342],{},"Each job uses its own collection on its own data. None of them feeds into another.",[1080,2344,2345,2346,2349,2350,2353],{},"Each step below shows one piece of a single program: every ",[1084,2347,2348],{},"import"," shown actually belongs at the top of the file (once each, even though they're introduced step by step here), and every statement runs inside one ",[1084,2351,2352],{},"main"," method.",[1161,2355,2357,2358],{"id":2356},"step-2-flag-repeats-and-count-unique-teams-set","Step 2: Flag Repeats and Count Unique Teams — ",[1084,2359,1097],{},[1180,2361,2363],{"className":1182,"code":2362,"language":1184,"meta":1185,"style":1185},"import java.util.Set;\nimport java.util.TreeSet;\n\nint[] scoutedTeams = {254, 1622, 4414, 254, 1678, 1622};\n\nSet\u003CInteger> uniqueTeams = new TreeSet\u003CInteger>();\nfor (int team : scoutedTeams)\n{\n    if (!uniqueTeams.add(team)) \u002F\u002F add() returns false if the team was already in the set\n    {\n        System.out.println(\"Already scouted: \" + team);\n    }\n}\nSystem.out.println(uniqueTeams.size() + \" different teams scouted\");\n",[1084,2364,2365,2370,2375,2379,2384,2388,2393,2398,2402,2407,2412,2418,2423,2428],{"__ignoreMap":1185},[1189,2366,2367],{"class":1191,"line":1192},[1189,2368,2369],{},"import java.util.Set;\n",[1189,2371,2372],{"class":1191,"line":1198},[1189,2373,2374],{},"import java.util.TreeSet;\n",[1189,2376,2377],{"class":1191,"line":1204},[1189,2378,1467],{"emptyLinePlaceholder":1466},[1189,2380,2381],{"class":1191,"line":1236},[1189,2382,2383],{},"int[] scoutedTeams = {254, 1622, 4414, 254, 1678, 1622};\n",[1189,2385,2386],{"class":1191,"line":1242},[1189,2387,1467],{"emptyLinePlaceholder":1466},[1189,2389,2390],{"class":1191,"line":1248},[1189,2391,2392],{},"Set\u003CInteger> uniqueTeams = new TreeSet\u003CInteger>();\n",[1189,2394,2395],{"class":1191,"line":1254},[1189,2396,2397],{},"for (int team : scoutedTeams)\n",[1189,2399,2400],{"class":1191,"line":1260},[1189,2401,1233],{},[1189,2403,2404],{"class":1191,"line":1489},[1189,2405,2406],{},"    if (!uniqueTeams.add(team)) \u002F\u002F add() returns false if the team was already in the set\n",[1189,2408,2410],{"class":1191,"line":2409},10,[1189,2411,1245],{},[1189,2413,2415],{"class":1191,"line":2414},11,[1189,2416,2417],{},"        System.out.println(\"Already scouted: \" + team);\n",[1189,2419,2421],{"class":1191,"line":2420},12,[1189,2422,1257],{},[1189,2424,2426],{"class":1191,"line":2425},13,[1189,2427,1263],{},[1189,2429,2431],{"class":1191,"line":2430},14,[1189,2432,2433],{},"System.out.println(uniqueTeams.size() + \" different teams scouted\");\n",[1080,2435,2436],{},"Output:",[1180,2438,2443],{"className":2439,"code":2441,"language":2442},[2440],"language-text","Already scouted: 254\nAlready scouted: 1622\n4 different teams scouted\n","text",[1084,2444,2441],{"__ignoreMap":1185},[1080,2446,2447,2448,2451,2452,2455,2456,2458,2459,2462,2463,2077],{},"The second ",[1084,2449,2450],{},"add(254)"," and second ",[1084,2453,2454],{},"add(1622)"," return ",[1084,2457,1177],{}," and change nothing, so the set ends with 4 teams, not 6. The variable is declared as the interface type ",[1084,2460,2461],{},"Set\u003CInteger>",". Only the right-hand side says ",[1084,2464,1287],{},[1080,2466,2467],{},"Now print the teams:",[1180,2469,2471],{"className":1182,"code":2470,"language":1184,"meta":1185,"style":1185},"for (int team : uniqueTeams)\n{\n    System.out.println(team);\n}\n",[1084,2472,2473,2478,2482,2487],{"__ignoreMap":1185},[1189,2474,2475],{"class":1191,"line":1192},[1189,2476,2477],{},"for (int team : uniqueTeams)\n",[1189,2479,2480],{"class":1191,"line":1198},[1189,2481,1233],{},[1189,2483,2484],{"class":1191,"line":1204},[1189,2485,2486],{},"    System.out.println(team);\n",[1189,2488,2489],{"class":1191,"line":1236},[1189,2490,1263],{},[1080,2492,2436],{},[1180,2494,2497],{"className":2495,"code":2496,"language":2442},[2440],"254\n1622\n1678\n4414\n",[1084,2498,2496],{"__ignoreMap":1185},[1080,2500,2501,2502,2504,2505,2507,2508,2511,2512,2053,2514,2516,2517,2077],{},"That's numeric order, not the order the teams were scouted (254, 1622, 4414, 1678). A ",[1084,2503,1287],{}," keeps its elements sorted. If this had been a ",[1084,2506,1279],{},", the same 4 teams would print in ",[1544,2509,2510],{},"no guaranteed order",". Changing ",[1084,2513,1151],{},[1084,2515,1148],{}," is the only edit needed to switch, and the rest of the code stays the same because it only depends on ",[1084,2518,1097],{},[1161,2520,2522,2523],{"id":2521},"step-3-upload-reports-oldest-first-queue","Step 3: Upload Reports Oldest First — ",[1084,2524,1103],{},[1180,2526,2528],{"className":1182,"code":2527,"language":1184,"meta":1185,"style":1185},"import java.util.LinkedList;\nimport java.util.Queue;\n\nQueue\u003CString> pendingUploads = new LinkedList\u003CString>();\npendingUploads.offer(\"Qual 12 report\");\npendingUploads.offer(\"Qual 13 report\");\npendingUploads.offer(\"Qual 14 report\");\n\nSystem.out.println(\"Next up: \" + pendingUploads.peek());\n\nwhile (!pendingUploads.isEmpty())\n{\n    System.out.println(\"Uploading \" + pendingUploads.poll());\n}\n",[1084,2529,2530,2535,2540,2544,2549,2554,2559,2564,2568,2573,2577,2582,2586,2591],{"__ignoreMap":1185},[1189,2531,2532],{"class":1191,"line":1192},[1189,2533,2534],{},"import java.util.LinkedList;\n",[1189,2536,2537],{"class":1191,"line":1198},[1189,2538,2539],{},"import java.util.Queue;\n",[1189,2541,2542],{"class":1191,"line":1204},[1189,2543,1467],{"emptyLinePlaceholder":1466},[1189,2545,2546],{"class":1191,"line":1236},[1189,2547,2548],{},"Queue\u003CString> pendingUploads = new LinkedList\u003CString>();\n",[1189,2550,2551],{"class":1191,"line":1242},[1189,2552,2553],{},"pendingUploads.offer(\"Qual 12 report\");\n",[1189,2555,2556],{"class":1191,"line":1248},[1189,2557,2558],{},"pendingUploads.offer(\"Qual 13 report\");\n",[1189,2560,2561],{"class":1191,"line":1254},[1189,2562,2563],{},"pendingUploads.offer(\"Qual 14 report\");\n",[1189,2565,2566],{"class":1191,"line":1260},[1189,2567,1467],{"emptyLinePlaceholder":1466},[1189,2569,2570],{"class":1191,"line":1489},[1189,2571,2572],{},"System.out.println(\"Next up: \" + pendingUploads.peek());\n",[1189,2574,2575],{"class":1191,"line":2409},[1189,2576,1467],{"emptyLinePlaceholder":1466},[1189,2578,2579],{"class":1191,"line":2414},[1189,2580,2581],{},"while (!pendingUploads.isEmpty())\n",[1189,2583,2584],{"class":1191,"line":2420},[1189,2585,1233],{},[1189,2587,2588],{"class":1191,"line":2425},[1189,2589,2590],{},"    System.out.println(\"Uploading \" + pendingUploads.poll());\n",[1189,2592,2593],{"class":1191,"line":2430},[1189,2594,1263],{},[1080,2596,2436],{},[1180,2598,2601],{"className":2599,"code":2600,"language":2442},[2440],"Next up: Qual 12 report\nUploading Qual 12 report\nUploading Qual 13 report\nUploading Qual 14 report\n",[1084,2602,2600],{"__ignoreMap":1185},[1080,2604,2605,2607,2608,2610],{},[1084,2606,1439],{}," looks at the oldest report without removing it, so the queue still holds all 3 when the loop starts. Each ",[1084,2609,1420],{}," then removes and returns the oldest remaining report, which is FIFO order.",[1080,2612,2613],{},"Once the loop ends, the queue is empty. An empty upload queue is completely normal (nothing left to send), so the safe forms are the right choice here:",[1180,2615,2617],{"className":1182,"code":2616,"language":1184,"meta":1185,"style":1185},"System.out.println(pendingUploads.poll()); \u002F\u002F null — no exception\n",[1084,2618,2619],{"__ignoreMap":1185},[1189,2620,2621],{"class":1191,"line":1192},[1189,2622,2616],{},[1080,2624,2625,2627,2628,2077],{},[1084,2626,1415],{}," in that same spot would throw an exception instead of returning ",[1084,2629,1423],{},[1161,2631,2633,2634,1270,2636],{"id":2632},"step-4-print-every-teams-auto-score-sorted-map-and-entryset","Step 4: Print Every Team's Auto Score, Sorted — ",[1084,2635,1115],{},[1084,2637,2336],{},[1080,2639,2640,2641,1779],{},"The scores were recorded into a plain ",[1084,2642,1090],{},[1180,2644,2646],{"className":1182,"code":2645,"language":1184,"meta":1185,"style":1185},"import java.util.HashMap;\nimport java.util.Map;\nimport java.util.TreeMap;\n\nMap\u003CInteger, Integer> autoPoints = new HashMap\u003CInteger, Integer>();\nautoPoints.put(4414, 15);\nautoPoints.put(254, 18);\nautoPoints.put(1622, 12);\n",[1084,2647,2648,2653,2658,2663,2667,2672,2677,2682],{"__ignoreMap":1185},[1189,2649,2650],{"class":1191,"line":1192},[1189,2651,2652],{},"import java.util.HashMap;\n",[1189,2654,2655],{"class":1191,"line":1198},[1189,2656,2657],{},"import java.util.Map;\n",[1189,2659,2660],{"class":1191,"line":1204},[1189,2661,2662],{},"import java.util.TreeMap;\n",[1189,2664,2665],{"class":1191,"line":1236},[1189,2666,1467],{"emptyLinePlaceholder":1466},[1189,2668,2669],{"class":1191,"line":1242},[1189,2670,2671],{},"Map\u003CInteger, Integer> autoPoints = new HashMap\u003CInteger, Integer>();\n",[1189,2673,2674],{"class":1191,"line":1248},[1189,2675,2676],{},"autoPoints.put(4414, 15);\n",[1189,2678,2679],{"class":1191,"line":1254},[1189,2680,2681],{},"autoPoints.put(254, 18);\n",[1189,2683,2684],{"class":1191,"line":1260},[1189,2685,2686],{},"autoPoints.put(1622, 12);\n",[1080,2688,2689,2690,2692,2693,2695,2696,2698,2699,2701],{},"Looping over a ",[1084,2691,1090],{}," gives no ordering guarantee. To print sorted by team number, copy it into a ",[1084,2694,1844],{},", then loop over ",[1084,2697,2336],{}," so each key and its value come out together, with no extra ",[1084,2700,1767],{}," call:",[1180,2703,2705],{"className":1182,"code":2704,"language":1184,"meta":1185,"style":1185},"Map\u003CInteger, Integer> sortedAutoPoints = new TreeMap\u003CInteger, Integer>(autoPoints);\nfor (Map.Entry\u003CInteger, Integer> entry : sortedAutoPoints.entrySet())\n{\n    System.out.println(\"Team \" + entry.getKey() + \": \" + entry.getValue() + \" auto points\");\n}\n",[1084,2706,2707,2712,2717,2721,2726],{"__ignoreMap":1185},[1189,2708,2709],{"class":1191,"line":1192},[1189,2710,2711],{},"Map\u003CInteger, Integer> sortedAutoPoints = new TreeMap\u003CInteger, Integer>(autoPoints);\n",[1189,2713,2714],{"class":1191,"line":1198},[1189,2715,2716],{},"for (Map.Entry\u003CInteger, Integer> entry : sortedAutoPoints.entrySet())\n",[1189,2718,2719],{"class":1191,"line":1204},[1189,2720,1233],{},[1189,2722,2723],{"class":1191,"line":1236},[1189,2724,2725],{},"    System.out.println(\"Team \" + entry.getKey() + \": \" + entry.getValue() + \" auto points\");\n",[1189,2727,2728],{"class":1191,"line":1242},[1189,2729,1263],{},[1080,2731,2436],{},[1180,2733,2736],{"className":2734,"code":2735,"language":2442},[2440],"Team 254: 18 auto points\nTeam 1622: 12 auto points\nTeam 4414: 15 auto points\n",[1084,2737,2735],{"__ignoreMap":1185},[1080,2739,2740,2741,2744,2745,2747],{},"The teams were ",[1084,2742,2743],{},"put()"," in as 4414, 254, 1622, but they print as 254, 1622, 4414 because a ",[1084,2746,1844],{}," keeps its keys sorted.",[1161,2749,2751],{"id":2750},"recap","Recap",[2000,2753,2754,2766,2778,2792,2800],{},[2003,2755,1167,2756,2758,2759,2762,2763,2765],{},[1084,2757,1097],{}," quietly refuses duplicates. ",[1084,2760,2761],{},"add()"," returns ",[1084,2764,1177],{}," for a repeat, which makes it an easy duplicate detector.",[2003,2767,2768,1104,2770,2772,2773,1104,2775,2777],{},[1084,2769,1287],{},[1084,2771,1844],{}," keep sorted order. ",[1084,2774,1279],{},[1084,2776,1090],{}," guarantee no order at all.",[2003,2779,1167,2780,2782,2783,2785,2786,2788,2789,2791],{},[1084,2781,1103],{}," hands elements back oldest-first. ",[1084,2784,1439],{}," looks without removing, ",[1084,2787,1420],{}," removes, and both return ",[1084,2790,1423],{}," on an empty queue instead of throwing.",[2003,2793,2794,2796,2797,2799],{},[1084,2795,2336],{}," loops over a map's keys and values together as ",[1084,2798,2211],{}," pairs.",[2003,2801,2802,2803,1129,2805,1129,2807,2809,2810,2813],{},"Declaring every variable by its interface type (",[1084,2804,1097],{},[1084,2806,1103],{},[1084,2808,1115],{},") means switching implementations only changes the ",[1084,2811,2812],{},"new ..."," part.",[2256,2815,2258],{},{"title":1185,"searchDepth":1198,"depth":1198,"links":2817},[2818,2819,2820,2822,2824,2826],{"id":2284,"depth":1198,"text":2285},{"id":2307,"depth":1198,"text":2308},{"id":2356,"depth":1198,"text":2821},"Step 2: Flag Repeats and Count Unique Teams — Set",{"id":2521,"depth":1198,"text":2823},"Step 3: Upload Reports Oldest First — Queue",{"id":2632,"depth":1198,"text":2825},"Step 4: Print Every Team's Auto Score, Sorted — Map and entrySet()",{"id":2750,"depth":1198,"text":2751},{"outlineRef":2271,"pairsWith":2828,"status":2829},"[`lessons\u002Fch15-advanced-collections\u002F15-advanced-collections.md`](..\u002F..\u002Flessons\u002Fch15-advanced-collections\u002F15-advanced-collections.md)","new — authored worked example (fully solved, walked step by step — not a problem to attempt)",{"title":635,"description":1185},"JQZSwxMWNB9b5Z7nQTXgS4Hyz7Dhqj4Cqkff5m7v178",{"id":2833,"title":948,"body":2834,"description":1185,"extension":2269,"meta":3760,"navigation":1466,"path":947,"seo":3762,"stem":949,"__hash__":3763},"exercises\u002Fshockwave-curriculum\u002Fexercises\u002Fch15-advanced-collections\u002F15-advanced-collections.md",{"type":1073,"value":2835,"toc":3755},[2836,2839,2843,2849,2869,2890,2895,2921,2927,2945,2976,2980,2993,2996,3070,3075,3081,3146,3218,3222,3228,3252,3258,3285,3290,3426,3431,3436,3442,3447,3453,3458,3462,3468,3472,3478,3483,3487,3493,3497,3503,3508,3512,3518,3522,3528,3533,3537,3543,3547,3553,3558,3715,3753],[1076,2837,948],{"id":2838},"advanced-collections-setqueuemap-exercises",[1161,2840,2842],{"id":2841},"multiple-choice","Multiple Choice",[1080,2844,2845,2848],{},[1093,2846,2847],{},"Question:"," A pit checklist adds subsystem names to a set in this order:",[1180,2850,2852],{"className":1182,"code":2851,"language":1184,"meta":1185,"style":1185},"checkedSubsystems.add(\"Shooter\");\ncheckedSubsystems.add(\"Intake\");\ncheckedSubsystems.add(\"Climber\");\n",[1084,2853,2854,2859,2864],{"__ignoreMap":1185},[1189,2855,2856],{"class":1191,"line":1192},[1189,2857,2858],{},"checkedSubsystems.add(\"Shooter\");\n",[1189,2860,2861],{"class":1191,"line":1198},[1189,2862,2863],{},"checkedSubsystems.add(\"Intake\");\n",[1189,2865,2866],{"class":1191,"line":1204},[1189,2867,2868],{},"checkedSubsystems.add(\"Climber\");\n",[1080,2870,2871,2872,2875,2876,2879,2880,1129,2883,1129,2886,2889],{},"The team wants a for-each loop over ",[1084,2873,2874],{},"checkedSubsystems"," to be ",[1093,2877,2878],{},"guaranteed"," to print ",[1084,2881,2882],{},"Shooter",[1084,2884,2885],{},"Intake",[1084,2887,2888],{},"Climber",", in exactly the order they were added. Which declaration guarantees that?",[1080,2891,2892],{},[1093,2893,2894],{},"Options:",[2000,2896,2897,2903,2909,2915],{},[2003,2898,2899,2900],{},"A. ",[1084,2901,2902],{},"Set\u003CString> checkedSubsystems = new HashSet\u003CString>();",[2003,2904,2905,2906],{},"B. ",[1084,2907,2908],{},"Set\u003CString> checkedSubsystems = new LinkedHashSet\u003CString>();",[2003,2910,2911,2912],{},"C. ",[1084,2913,2914],{},"Set\u003CString> checkedSubsystems = new TreeSet\u003CString>();",[2003,2916,2917,2918,2920],{},"D. Any of the three. Every ",[1084,2919,1097],{}," remembers the order elements were added.",[1080,2922,2923,2926],{},[1093,2924,2925],{},"Answer:"," B",[1080,2928,2929,1333,2932,2934,2935,2937,2938,1129,2940,1129,2942,2944],{},[1093,2930,2931],{},"Why:",[1084,2933,1283],{}," is the ",[1084,2936,1097],{}," implementation that remembers insertion order. Looping over it gives ",[1084,2939,2882],{},[1084,2941,2885],{},[1084,2943,2888],{},", exactly as added.",[2000,2946,2947,2953,2970],{},[2003,2948,2949,2950,2952],{},"A is wrong because a ",[1084,2951,1279],{}," makes no ordering guarantee at all. It might happen to print in insertion order on some run, but nothing guarantees it, and the lesson warns against assuming it does.",[2003,2954,2955,2956,2958,2959,2962,2963,1129,2965,1129,2967,2969],{},"C is wrong because a ",[1084,2957,1287],{}," keeps its elements ",[1544,2960,2961],{},"sorted",", not in insertion order. It would print ",[1084,2964,2888],{},[1084,2966,2885],{},[1084,2968,2882],{}," (alphabetical).",[2003,2971,2972,2973,2975],{},"D is wrong because the three implementations all refuse duplicates, but they differ in exactly this way: iteration order. Only ",[1084,2974,1283],{}," keeps insertion order.",[1161,2977,2979],{"id":2978},"micro-parsons","Micro-Parsons",[1080,2981,2982,2985,2986,2989,2990,2077],{},[1093,2983,2984],{},"Problem:"," These lines, once correctly ordered, form a complete program that loads two game pieces into a hopper, one after the other, then feeds out the piece that was loaded ",[1093,2987,2988],{},"most recently"," (last-in, first-out) and prints it. The program should print ",[1084,2991,2992],{},"Note 2",[1080,2994,2995],{},"Reorder the fragments below into a working program:",[2000,2997,2998,3004,3010,3016,3022,3028,3034,3040,3046,3052,3058,3064],{},[2003,2999,3000,3001],{},"a. ",[1084,3002,3003],{},"        hopper.addLast(\"Note 2\");",[2003,3005,3006,3007],{},"b. ",[1084,3008,3009],{},"public class HopperStack",[2003,3011,3012,3013],{},"c. ",[1084,3014,3015],{},"    }",[2003,3017,3018,3019],{},"d. ",[1084,3020,3021],{},"import java.util.Deque;",[2003,3023,3024,3025],{},"e. ",[1084,3026,3027],{},"        Deque\u003CString> hopper = new ArrayDeque\u003CString>();",[2003,3029,3030,3031],{},"f. ",[1084,3032,3033],{},"{",[2003,3035,3036,3037],{},"g. ",[1084,3038,3039],{},"        System.out.println(hopper.removeLast());",[2003,3041,3042,3043],{},"h. ",[1084,3044,3045],{},"    public static void main(String[] args)",[2003,3047,3048,3049],{},"i. ",[1084,3050,3051],{},"import java.util.ArrayDeque;",[2003,3053,3054,3055],{},"j. ",[1084,3056,3057],{},"}",[2003,3059,3060,3061],{},"k. ",[1084,3062,3063],{},"        hopper.addLast(\"Note 1\");",[2003,3065,3066,3067],{},"l. ",[1084,3068,3069],{},"    {",[1080,3071,3072,3074],{},[1093,3073,2925],{}," i, d, b, f, h, l, e, k, a, g, c, j",[1080,3076,3077,3080],{},[1093,3078,3079],{},"Interchangeable:"," (i, d)",[1180,3082,3084],{"className":1182,"code":3083,"language":1184,"meta":1185,"style":1185},"import java.util.ArrayDeque;\nimport java.util.Deque;\n\npublic class HopperStack\n{\n    public static void main(String[] args)\n    {\n        Deque\u003CString> hopper = new ArrayDeque\u003CString>();\n        hopper.addLast(\"Note 1\");\n        hopper.addLast(\"Note 2\");\n        System.out.println(hopper.removeLast());\n    }\n}\n",[1084,3085,3086,3091,3096,3100,3105,3109,3114,3118,3123,3128,3133,3138,3142],{"__ignoreMap":1185},[1189,3087,3088],{"class":1191,"line":1192},[1189,3089,3090],{},"import java.util.ArrayDeque;\n",[1189,3092,3093],{"class":1191,"line":1198},[1189,3094,3095],{},"import java.util.Deque;\n",[1189,3097,3098],{"class":1191,"line":1204},[1189,3099,1467],{"emptyLinePlaceholder":1466},[1189,3101,3102],{"class":1191,"line":1236},[1189,3103,3104],{},"public class HopperStack\n",[1189,3106,3107],{"class":1191,"line":1242},[1189,3108,1233],{},[1189,3110,3111],{"class":1191,"line":1248},[1189,3112,3113],{},"    public static void main(String[] args)\n",[1189,3115,3116],{"class":1191,"line":1254},[1189,3117,1245],{},[1189,3119,3120],{"class":1191,"line":1260},[1189,3121,3122],{},"        Deque\u003CString> hopper = new ArrayDeque\u003CString>();\n",[1189,3124,3125],{"class":1191,"line":1489},[1189,3126,3127],{},"        hopper.addLast(\"Note 1\");\n",[1189,3129,3130],{"class":1191,"line":2409},[1189,3131,3132],{},"        hopper.addLast(\"Note 2\");\n",[1189,3134,3135],{"class":1191,"line":2414},[1189,3136,3137],{},"        System.out.println(hopper.removeLast());\n",[1189,3139,3140],{"class":1191,"line":2420},[1189,3141,1257],{},[1189,3143,3144],{"class":1191,"line":2425},[1189,3145,1263],{},[1080,3147,3148,3151,3152,1129,3155,3158,3159,1129,3162,1129,3165,1129,3168,3171,3172,3174,3175,3178,3179,3182,3183,3186,3187,3190,3191,3194,3195,3197,3198,3190,3200,3203,3204,3206,3207,3209,3210,3213,3214,3217],{},[1093,3149,3150],{},"Why this order:"," Both imports (",[1084,3153,3154],{},"i",[1084,3156,3157],{},"d",") come before the class, in either order, since neither depends on the other. The usual class\u002Fmain scaffolding (",[1084,3160,3161],{},"b",[1084,3163,3164],{},"f",[1084,3166,3167],{},"h",[1084,3169,3170],{},"l",") follows. The ",[1084,3173,1109],{}," has to be created (",[1084,3176,3177],{},"e",") before anything can be added to it. ",[1084,3180,3181],{},"\"Note 1\""," must be added (",[1084,3184,3185],{},"k",") before ",[1084,3188,3189],{},"\"Note 2\""," (",[1084,3192,3193],{},"a","). Swapping those two would make ",[1084,3196,3181],{}," the most recent piece and change what gets printed. ",[1084,3199,1604],{},[1084,3201,3202],{},"g",") then takes from the same end the pieces were added to, so it returns the most recently added piece, ",[1084,3205,3189],{},". The braces close in reverse: ",[1084,3208,2352],{},"'s body (",[1084,3211,3212],{},"c","), then the class's body (",[1084,3215,3216],{},"j",").",[1161,3219,3221],{"id":3220},"coding","Coding",[1080,3223,3224,3227],{},[1093,3225,3226],{},"Mode:"," full-program",[1080,3229,3230,3232,3233,3236,3237,3240,3241,3243,3244,3247,3248,3251],{},[1093,3231,2984],{}," Before a match, the wiring team lists every CAN ID on the robot. Write the class\n",[1084,3234,3235],{},"CanChecker"," with a static method ",[1084,3238,3239],{},"findDuplicates"," that takes the array of IDs and returns a\n",[1084,3242,2461],{}," of every ID that appears ",[1093,3245,3246],{},"more than once",". The set must list the duplicates in the\norder each one was ",[1093,3249,3250],{},"first caught as a duplicate"," while reading the array left to right (the first\ntime an ID shows up a second time). Each duplicate ID appears in the set only once, even if it is\nwired three times. If nothing is duplicated, return an empty set.",[1080,3253,3254,3255,3257],{},"The fixed ",[1084,3256,2352],{}," reads the number of IDs, then the IDs, and prints the set you return.",[1080,3259,3260,3261,3264,3265,2241,3268,3271,3272,3275,3276,3278,3279,3264,3282,2077],{},"For example, the IDs ",[1084,3262,3263],{},"4 7 4 2 7 7"," print ",[1084,3266,3267],{},"[4, 7]",[1084,3269,3270],{},"4"," repeats at index 2 and ",[1084,3273,3274],{},"7"," repeats at index 4,\nso ",[1084,3277,3270],{}," is caught first. The IDs ",[1084,3280,3281],{},"1 2 3",[1084,3283,3284],{},"[]",[1080,3286,3287],{},[1093,3288,3289],{},"Starter:",[1180,3291,3293],{"className":1182,"code":3292,"language":1184,"meta":1185,"style":1185},"import java.util.*;\n\npublic class Main\n{\n    \u002F\u002F Don't change main\n    public static void main(String[] args)\n    {\n        Scanner in = new Scanner(System.in);\n        int count = in.nextInt();\n        int[] ids = new int[count];\n        for (int i = 0; i \u003C count; i++)\n        {\n            ids[i] = in.nextInt();\n        }\n        System.out.println(CanChecker.findDuplicates(ids));\n    }\n}\n\nclass CanChecker\n{\n    public static Set\u003CInteger> findDuplicates(int[] ids)\n    {\n        \u002F\u002F TODO: return the IDs that appear more than once, in the order each was first caught\n        return null;\n    }\n}\n",[1084,3294,3295,3300,3304,3309,3313,3318,3322,3326,3331,3336,3341,3346,3351,3356,3361,3367,3372,3377,3382,3388,3393,3399,3404,3410,3416,3421],{"__ignoreMap":1185},[1189,3296,3297],{"class":1191,"line":1192},[1189,3298,3299],{},"import java.util.*;\n",[1189,3301,3302],{"class":1191,"line":1198},[1189,3303,1467],{"emptyLinePlaceholder":1466},[1189,3305,3306],{"class":1191,"line":1204},[1189,3307,3308],{},"public class Main\n",[1189,3310,3311],{"class":1191,"line":1236},[1189,3312,1233],{},[1189,3314,3315],{"class":1191,"line":1242},[1189,3316,3317],{},"    \u002F\u002F Don't change main\n",[1189,3319,3320],{"class":1191,"line":1248},[1189,3321,3113],{},[1189,3323,3324],{"class":1191,"line":1254},[1189,3325,1245],{},[1189,3327,3328],{"class":1191,"line":1260},[1189,3329,3330],{},"        Scanner in = new Scanner(System.in);\n",[1189,3332,3333],{"class":1191,"line":1489},[1189,3334,3335],{},"        int count = in.nextInt();\n",[1189,3337,3338],{"class":1191,"line":2409},[1189,3339,3340],{},"        int[] ids = new int[count];\n",[1189,3342,3343],{"class":1191,"line":2414},[1189,3344,3345],{},"        for (int i = 0; i \u003C count; i++)\n",[1189,3347,3348],{"class":1191,"line":2420},[1189,3349,3350],{},"        {\n",[1189,3352,3353],{"class":1191,"line":2425},[1189,3354,3355],{},"            ids[i] = in.nextInt();\n",[1189,3357,3358],{"class":1191,"line":2430},[1189,3359,3360],{},"        }\n",[1189,3362,3364],{"class":1191,"line":3363},15,[1189,3365,3366],{},"        System.out.println(CanChecker.findDuplicates(ids));\n",[1189,3368,3370],{"class":1191,"line":3369},16,[1189,3371,1257],{},[1189,3373,3375],{"class":1191,"line":3374},17,[1189,3376,1263],{},[1189,3378,3380],{"class":1191,"line":3379},18,[1189,3381,1467],{"emptyLinePlaceholder":1466},[1189,3383,3385],{"class":1191,"line":3384},19,[1189,3386,3387],{},"class CanChecker\n",[1189,3389,3391],{"class":1191,"line":3390},20,[1189,3392,1233],{},[1189,3394,3396],{"class":1191,"line":3395},21,[1189,3397,3398],{},"    public static Set\u003CInteger> findDuplicates(int[] ids)\n",[1189,3400,3402],{"class":1191,"line":3401},22,[1189,3403,1245],{},[1189,3405,3407],{"class":1191,"line":3406},23,[1189,3408,3409],{},"        \u002F\u002F TODO: return the IDs that appear more than once, in the order each was first caught\n",[1189,3411,3413],{"class":1191,"line":3412},24,[1189,3414,3415],{},"        return null;\n",[1189,3417,3419],{"class":1191,"line":3418},25,[1189,3420,1257],{},[1189,3422,3424],{"class":1191,"line":3423},26,[1189,3425,1263],{},[1080,3427,3428],{},[1093,3429,3430],{},"Scenario 1 (visible):",[1080,3432,3433],{},[1093,3434,3435],{},"Input:",[1180,3437,3440],{"className":3438,"code":3439,"language":2442,"meta":1185},[2440],"6\n4 7 4 2 7 7\n",[1084,3441,3439],{"__ignoreMap":1185},[1080,3443,3444],{},[1093,3445,3446],{},"Expected output:",[1180,3448,3451],{"className":3449,"code":3450,"language":2442,"meta":1185},[2440],"[4, 7]\n",[1084,3452,3450],{"__ignoreMap":1185},[1080,3454,3455],{},[1093,3456,3457],{},"Scenario 2 (visible):",[1080,3459,3460],{},[1093,3461,3435],{},[1180,3463,3466],{"className":3464,"code":3465,"language":2442,"meta":1185},[2440],"3\n1 2 3\n",[1084,3467,3465],{"__ignoreMap":1185},[1080,3469,3470],{},[1093,3471,3446],{},[1180,3473,3476],{"className":3474,"code":3475,"language":2442,"meta":1185},[2440],"[]\n",[1084,3477,3475],{"__ignoreMap":1185},[1080,3479,3480],{},[1093,3481,3482],{},"Scenario 3 (hidden):",[1080,3484,3485],{},[1093,3486,3435],{},[1180,3488,3491],{"className":3489,"code":3490,"language":2442,"meta":1185},[2440],"7\n9 3 3 9 12 3 9\n",[1084,3492,3490],{"__ignoreMap":1185},[1080,3494,3495],{},[1093,3496,3446],{},[1180,3498,3501],{"className":3499,"code":3500,"language":2442,"meta":1185},[2440],"[3, 9]\n",[1084,3502,3500],{"__ignoreMap":1185},[1080,3504,3505],{},[1093,3506,3507],{},"Scenario 4 (hidden):",[1080,3509,3510],{},[1093,3511,3435],{},[1180,3513,3516],{"className":3514,"code":3515,"language":2442,"meta":1185},[2440],"5\n20 9 9 20 20\n",[1084,3517,3515],{"__ignoreMap":1185},[1080,3519,3520],{},[1093,3521,3446],{},[1180,3523,3526],{"className":3524,"code":3525,"language":2442,"meta":1185},[2440],"[9, 20]\n",[1084,3527,3525],{"__ignoreMap":1185},[1080,3529,3530],{},[1093,3531,3532],{},"Scenario 5 (hidden):",[1080,3534,3535],{},[1093,3536,3435],{},[1180,3538,3541],{"className":3539,"code":3540,"language":2442,"meta":1185},[2440],"8\n15 2 31 31 2 8 15 15\n",[1084,3542,3540],{"__ignoreMap":1185},[1080,3544,3545],{},[1093,3546,3446],{},[1180,3548,3551],{"className":3549,"code":3550,"language":2442,"meta":1185},[2440],"[31, 2, 15]\n",[1084,3552,3550],{"__ignoreMap":1185},[1080,3554,3555],{},[1093,3556,3557],{},"Solution:",[1180,3559,3561],{"className":1182,"code":3560,"language":1184,"meta":1185,"style":1185},"import java.util.*;\n\npublic class Main\n{\n    \u002F\u002F Don't change main\n    public static void main(String[] args)\n    {\n        Scanner in = new Scanner(System.in);\n        int count = in.nextInt();\n        int[] ids = new int[count];\n        for (int i = 0; i \u003C count; i++)\n        {\n            ids[i] = in.nextInt();\n        }\n        System.out.println(CanChecker.findDuplicates(ids));\n    }\n}\n\nclass CanChecker\n{\n    public static Set\u003CInteger> findDuplicates(int[] ids)\n    {\n        Set\u003CInteger> seen = new HashSet\u003CInteger>();\n        Set\u003CInteger> duplicates = new LinkedHashSet\u003CInteger>();\n        for (int id : ids)\n        {\n            if (!seen.add(id))\n            {\n                duplicates.add(id);\n            }\n        }\n        return duplicates;\n    }\n}\n",[1084,3562,3563,3567,3571,3575,3579,3583,3587,3591,3595,3599,3603,3607,3611,3615,3619,3623,3627,3631,3635,3639,3643,3647,3651,3656,3661,3666,3670,3676,3682,3688,3694,3699,3705,3710],{"__ignoreMap":1185},[1189,3564,3565],{"class":1191,"line":1192},[1189,3566,3299],{},[1189,3568,3569],{"class":1191,"line":1198},[1189,3570,1467],{"emptyLinePlaceholder":1466},[1189,3572,3573],{"class":1191,"line":1204},[1189,3574,3308],{},[1189,3576,3577],{"class":1191,"line":1236},[1189,3578,1233],{},[1189,3580,3581],{"class":1191,"line":1242},[1189,3582,3317],{},[1189,3584,3585],{"class":1191,"line":1248},[1189,3586,3113],{},[1189,3588,3589],{"class":1191,"line":1254},[1189,3590,1245],{},[1189,3592,3593],{"class":1191,"line":1260},[1189,3594,3330],{},[1189,3596,3597],{"class":1191,"line":1489},[1189,3598,3335],{},[1189,3600,3601],{"class":1191,"line":2409},[1189,3602,3340],{},[1189,3604,3605],{"class":1191,"line":2414},[1189,3606,3345],{},[1189,3608,3609],{"class":1191,"line":2420},[1189,3610,3350],{},[1189,3612,3613],{"class":1191,"line":2425},[1189,3614,3355],{},[1189,3616,3617],{"class":1191,"line":2430},[1189,3618,3360],{},[1189,3620,3621],{"class":1191,"line":3363},[1189,3622,3366],{},[1189,3624,3625],{"class":1191,"line":3369},[1189,3626,1257],{},[1189,3628,3629],{"class":1191,"line":3374},[1189,3630,1263],{},[1189,3632,3633],{"class":1191,"line":3379},[1189,3634,1467],{"emptyLinePlaceholder":1466},[1189,3636,3637],{"class":1191,"line":3384},[1189,3638,3387],{},[1189,3640,3641],{"class":1191,"line":3390},[1189,3642,1233],{},[1189,3644,3645],{"class":1191,"line":3395},[1189,3646,3398],{},[1189,3648,3649],{"class":1191,"line":3401},[1189,3650,1245],{},[1189,3652,3653],{"class":1191,"line":3406},[1189,3654,3655],{},"        Set\u003CInteger> seen = new HashSet\u003CInteger>();\n",[1189,3657,3658],{"class":1191,"line":3412},[1189,3659,3660],{},"        Set\u003CInteger> duplicates = new LinkedHashSet\u003CInteger>();\n",[1189,3662,3663],{"class":1191,"line":3418},[1189,3664,3665],{},"        for (int id : ids)\n",[1189,3667,3668],{"class":1191,"line":3423},[1189,3669,3350],{},[1189,3671,3673],{"class":1191,"line":3672},27,[1189,3674,3675],{},"            if (!seen.add(id))\n",[1189,3677,3679],{"class":1191,"line":3678},28,[1189,3680,3681],{},"            {\n",[1189,3683,3685],{"class":1191,"line":3684},29,[1189,3686,3687],{},"                duplicates.add(id);\n",[1189,3689,3691],{"class":1191,"line":3690},30,[1189,3692,3693],{},"            }\n",[1189,3695,3697],{"class":1191,"line":3696},31,[1189,3698,3360],{},[1189,3700,3702],{"class":1191,"line":3701},32,[1189,3703,3704],{},"        return duplicates;\n",[1189,3706,3708],{"class":1191,"line":3707},33,[1189,3709,1257],{},[1189,3711,3713],{"class":1191,"line":3712},34,[1189,3714,1263],{},[1080,3716,3717,3719,3720,3723,3724,3726,3727,3729,3730,3733,3734,3736,3737,3739,3740,3742,3743,3745,3746,3749,3750,2077],{},[1093,3718,2931],{}," Two sets do two different jobs. ",[1084,3721,3722],{},"seen"," is the lesson's duplicate-ID check: ",[1084,3725,1173],{}," returns\n",[1084,3728,1177],{}," when the ID is already there, which is exactly the \"second time\" signal. ",[1084,3731,3732],{},"duplicates"," has to\nremember the order each repeat was caught, so it is a ",[1084,3735,1283],{}," rather than a ",[1084,3738,1279],{},"; it\nalso silently ignores a third ",[1084,3741,1173],{}," of the same ID, so each duplicate is listed once. A plain\n",[1084,3744,1279],{}," promises no order at all, so it can print ",[1084,3747,3748],{},"[20, 9]"," where scenario 4 expects ",[1084,3751,3752],{},"[9, 20]",[2256,3754,2258],{},{"title":1185,"searchDepth":1198,"depth":1198,"links":3756},[3757,3758,3759],{"id":2841,"depth":1198,"text":2842},{"id":2978,"depth":1198,"text":2979},{"id":3220,"depth":1198,"text":3221},{"outlineRef":2271,"pairsWith":2828,"status":3761},"new — authored exercises (Multiple Choice + Micro-Parsons + Coding)",{"title":948,"description":1185},"7VqS0tN_jjA2Za7tcUxtmOAPuaOkWkxbf6kCCnIG-cQ",1792718166088]