<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://staging.moocwiki.org/index.php?action=history&amp;feed=atom&amp;title=English%3AArrays_and_Lists</id>
	<title>English:Arrays and Lists - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://staging.moocwiki.org/index.php?action=history&amp;feed=atom&amp;title=English%3AArrays_and_Lists"/>
	<link rel="alternate" type="text/html" href="https://staging.moocwiki.org/index.php?title=English:Arrays_and_Lists&amp;action=history"/>
	<updated>2026-08-28T10:59:23Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in MOOCsWiki Staging</subtitle>
	<generator>MediaWiki 1.45.4</generator>
	<entry>
		<id>https://staging.moocwiki.org/index.php?title=English:Arrays_and_Lists&amp;diff=47137&amp;oldid=prev</id>
		<title>Glanz: aiMOOC über GPT aiMOOC Action erstellt</title>
		<link rel="alternate" type="text/html" href="https://staging.moocwiki.org/index.php?title=English:Arrays_and_Lists&amp;diff=47137&amp;oldid=prev"/>
		<updated>2026-08-27T12:17:10Z</updated>

		<summary type="html">&lt;p&gt;aiMOOC über GPT aiMOOC Action erstellt&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{T}}&lt;br /&gt;
[[Category:English]]&lt;br /&gt;
[[Category:Arrays and Lists]]&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Arrays and Lists&amp;#039;&amp;#039;&amp;#039; are ways to organize many related values so that a program can work with them as a group. Instead of creating a separate variable for every score, name, temperature, or sensor reading, you can store the values in an ordered collection and process them with the same algorithm.&lt;br /&gt;
&lt;br /&gt;
This aiMOOC is designed for &amp;#039;&amp;#039;&amp;#039;Grades 9–10&amp;#039;&amp;#039;&amp;#039;. You should already be familiar with [[English:Variable (computer science)|variables]], simple [[English:Conditional (computer programming)|conditionals]], and [[English:Loop (computing)|loops]]. You will learn how arrays and lists represent sequences, how indexing works, how to read and update elements, how to traverse collections, and how to choose a suitable structure for a programming task.&lt;br /&gt;
&lt;br /&gt;
By the end of the course, you should be able to explain the difference between an [[English:Array (data structure)|array]] and a [[English:List (abstract data type)|list]], trace code that changes a sequence, write small programs that search or summarize data, use nested collections, and reason about common errors such as invalid indexes.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Why Collections Matter ==&lt;br /&gt;
&lt;br /&gt;
Imagine a class survey with 28 responses. Storing the answers in 28 separate variables would make the program repetitive and difficult to maintain. A collection gives the data a shared structure. This lets you ask useful questions such as: What is the first value? What is the largest value? How many values meet a condition? Where does a target value occur?&lt;br /&gt;
&lt;br /&gt;
Collections are central to [[English:Computer science|computer science]] because data often arrives as sequences: words in a sentence, pixels in an image, daily temperatures, player scores, products in a cart, or measurements from an experiment. Arrays and lists help you move from individual values to algorithms that work on whole datasets.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Learning Goals ==&lt;br /&gt;
&lt;br /&gt;
# [[English:Indexing|Indexing]]: Use indexes correctly to access and update elements.&lt;br /&gt;
# [[English:Iteration|Iteration]]: Traverse a sequence with loops and explain each step.&lt;br /&gt;
# [[English:List operations|List operations]]: Add, remove, replace, and search for values.&lt;br /&gt;
# [[English:Two-dimensional array|Two-dimensional data]]: Model rows and columns with nested collections.&lt;br /&gt;
# [[English:Algorithmic thinking|Algorithmic thinking]]: Compare solutions and predict how work grows as a collection becomes larger.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Arrays: Ordered Data by Position =&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;array&amp;#039;&amp;#039;&amp;#039; stores a sequence of elements that can be identified by position. In many languages, the elements of a basic array have the same type and the array has a fixed length once it is created. The exact rules depend on the programming language, so you should always check the language you are using.&lt;br /&gt;
&lt;br /&gt;
Most modern introductory languages use &amp;#039;&amp;#039;&amp;#039;zero-based indexing&amp;#039;&amp;#039;&amp;#039;. That means the first element is at index 0, the second is at index 1, and the final element of a collection of length &amp;#039;&amp;#039;n&amp;#039;&amp;#039; is usually at index &amp;#039;&amp;#039;n − 1&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:1D array diagram.svg|500px|frameless|center]]&lt;br /&gt;
&lt;br /&gt;
For example, consider the sequence of scores 12, 18, 15, 20. With zero-based indexing, the positions are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Index&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| 12&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 18&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 20&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The value 15 is at index 2. Notice that the human phrase “third item” and the computer index “2” describe the same element in a zero-based system.&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=gUOwZkL09BE|500|center}}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Reading and Updating Elements ==&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;element&amp;#039;&amp;#039;&amp;#039; is one stored item. An &amp;#039;&amp;#039;&amp;#039;index&amp;#039;&amp;#039;&amp;#039; identifies a position. In languages that use square-bracket notation, an expression such as &amp;lt;code&amp;gt;scores[2]&amp;lt;/code&amp;gt; reads the element at index 2.&lt;br /&gt;
&lt;br /&gt;
A Python-style example makes the idea easy to see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
scores = [12, 18, 15, 20]&lt;br /&gt;
&lt;br /&gt;
print(scores[0])   # first element: 12&lt;br /&gt;
print(scores[2])   # third element: 15&lt;br /&gt;
&lt;br /&gt;
scores[1] = 19     # replace 18 with 19&lt;br /&gt;
print(scores)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the assignment, the sequence is &amp;lt;code&amp;gt;[12, 19, 15, 20]&amp;lt;/code&amp;gt;. The length has not changed because one value was replaced by another.&lt;br /&gt;
&lt;br /&gt;
A useful tracing habit is to write the index and current value in a small table whenever you are unsure what a line of code does.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Length and Valid Indexes ==&lt;br /&gt;
&lt;br /&gt;
If a zero-based sequence has length 5, its valid indexes are 0, 1, 2, 3, and 4. Index 5 is outside the valid range. Trying to access an invalid position may cause an error or return a special value, depending on the language.&lt;br /&gt;
&lt;br /&gt;
The rule to remember is:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;For a zero-based sequence of length n, the last valid index is n − 1.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This is why loops often continue while an index is &amp;#039;&amp;#039;&amp;#039;less than&amp;#039;&amp;#039;&amp;#039; the length rather than less than or equal to the length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
names = [&amp;quot;Ava&amp;quot;, &amp;quot;Ben&amp;quot;, &amp;quot;Chen&amp;quot;, &amp;quot;Dina&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
for i in range(len(names)):&lt;br /&gt;
    print(i, names[i])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This loop visits indexes 0 through 3. It never attempts index 4.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Arrays and Memory ==&lt;br /&gt;
&lt;br /&gt;
A classical array is designed so that an element can be found quickly from its index. Many array implementations place equal-sized elements in a regular memory layout, allowing the computer to calculate where an indexed element is stored.&lt;br /&gt;
&lt;br /&gt;
[[File:Array Representations.svg|500px|frameless|center]]&lt;br /&gt;
&lt;br /&gt;
At Grades 9–10, you do not need to calculate memory addresses. The important idea is that arrays are built for efficient access by position. This is one reason arrays are useful for tables, measurements, images, game boards, and other data where positions matter.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Lists: Flexible Sequences =&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;list&amp;#039;&amp;#039;&amp;#039; in computer science is an ordered finite sequence of items. The word “list” can describe an abstract idea as well as a concrete data structure. A list usually supports operations such as reading items, inserting items, deleting items, and traversing the sequence.&lt;br /&gt;
&lt;br /&gt;
In Python, the built-in &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt; is a mutable sequence whose size can grow or shrink. In Java, a basic array has a fixed length, while an &amp;lt;code&amp;gt;ArrayList&amp;lt;/code&amp;gt; is designed to resize. In JavaScript, &amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt; objects are resizable. These language differences are why it is better to learn the underlying concepts instead of assuming that every language uses the same rules.&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=KFy7u3Rhozs|500|center}}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Common List Operations ==&lt;br /&gt;
&lt;br /&gt;
Consider this Python list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
tasks = [&amp;quot;read&amp;quot;, &amp;quot;code&amp;quot;, &amp;quot;test&amp;quot;]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can perform several common operations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
tasks.append(&amp;quot;reflect&amp;quot;)        # add at the end&lt;br /&gt;
tasks.insert(1, &amp;quot;plan&amp;quot;)        # insert at index 1&lt;br /&gt;
tasks[2] = &amp;quot;program&amp;quot;           # replace one item&lt;br /&gt;
tasks.remove(&amp;quot;test&amp;quot;)           # remove the first matching value&lt;br /&gt;
last_task = tasks.pop()        # remove and return the final item&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These operations change the list. A structure that can be changed after creation is called &amp;#039;&amp;#039;&amp;#039;mutable&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
When you read code, distinguish carefully between three different actions: &amp;#039;&amp;#039;&amp;#039;accessing&amp;#039;&amp;#039;&amp;#039; an item, &amp;#039;&amp;#039;&amp;#039;replacing&amp;#039;&amp;#039;&amp;#039; an item, and &amp;#039;&amp;#039;&amp;#039;changing the length&amp;#039;&amp;#039;&amp;#039; of the collection.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Arrays, Dynamic Arrays, and Linked Lists ==&lt;br /&gt;
&lt;br /&gt;
The terms can be confusing because different structures can provide a similar “list-like” experience.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Structure&lt;br /&gt;
! Main idea&lt;br /&gt;
! Size behavior&lt;br /&gt;
! Position access&lt;br /&gt;
|-&lt;br /&gt;
| Basic array&lt;br /&gt;
| Elements are arranged for direct indexed access&lt;br /&gt;
| Often fixed after creation&lt;br /&gt;
| Usually fast&lt;br /&gt;
|-&lt;br /&gt;
| Dynamic array&lt;br /&gt;
| An array-based structure that can resize&lt;br /&gt;
| Can grow or shrink&lt;br /&gt;
| Usually fast&lt;br /&gt;
|-&lt;br /&gt;
| Linked list&lt;br /&gt;
| Each node stores data and a link to another node&lt;br /&gt;
| Can grow or shrink&lt;br /&gt;
| Requires following links to reach a position&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A linked list illustrates that a “list” does not have to be stored like an array.&lt;br /&gt;
&lt;br /&gt;
[[File:Singly-linked-list.svg|500px|frameless|center]]&lt;br /&gt;
&lt;br /&gt;
A Python list should not be confused with a textbook linked list. It behaves as a resizable indexed sequence. For this course, focus first on the operations you need and then on how different structures support those operations.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Traversing a Collection =&lt;br /&gt;
&lt;br /&gt;
To &amp;#039;&amp;#039;&amp;#039;traverse&amp;#039;&amp;#039;&amp;#039; a collection means to visit its elements in a systematic order. Loops make this possible.&lt;br /&gt;
&lt;br /&gt;
If you only need each value, a direct loop is often simplest:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
temperatures = [16, 18, 21, 19]&lt;br /&gt;
&lt;br /&gt;
for temperature in temperatures:&lt;br /&gt;
    print(temperature)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need both the index and the value, you can use an indexed loop or a language feature that provides both:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
temperatures = [16, 18, 21, 19]&lt;br /&gt;
&lt;br /&gt;
for index, temperature in enumerate(temperatures):&lt;br /&gt;
    print(index, temperature)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ask yourself what information your algorithm needs. If the position itself is important, keep the index. If only the values matter, a direct element loop can be clearer.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Accumulation: Building a Result ==&lt;br /&gt;
&lt;br /&gt;
Many collection algorithms maintain a result while they traverse the data. This pattern is called &amp;#039;&amp;#039;&amp;#039;accumulation&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
scores = [7, 9, 6, 10, 8]&lt;br /&gt;
total = 0&lt;br /&gt;
&lt;br /&gt;
for score in scores:&lt;br /&gt;
    total = total + score&lt;br /&gt;
&lt;br /&gt;
average = total / len(scores)&lt;br /&gt;
print(average)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variable &amp;lt;code&amp;gt;total&amp;lt;/code&amp;gt; changes after each element. You can trace the algorithm by recording the current score and the new total after every loop iteration.&lt;br /&gt;
&lt;br /&gt;
Other accumulation tasks include counting values that satisfy a condition, joining pieces of text, and building a new list.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Filtering: Selecting Some Elements ==&lt;br /&gt;
&lt;br /&gt;
Filtering means keeping items that satisfy a rule.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
scores = [7, 9, 6, 10, 8]&lt;br /&gt;
high_scores = []&lt;br /&gt;
&lt;br /&gt;
for score in scores:&lt;br /&gt;
    if score &amp;gt;= 9:&lt;br /&gt;
        high_scores.append(score)&lt;br /&gt;
&lt;br /&gt;
print(high_scores)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is &amp;lt;code&amp;gt;[9, 10]&amp;lt;/code&amp;gt;. The original list remains unchanged in this example because the matching values are copied into a new list.&lt;br /&gt;
&lt;br /&gt;
Filtering is useful in real applications such as selecting affordable products, finding measurements above a threshold, or displaying messages from a chosen sender.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Searching: Finding a Target ==&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;linear search&amp;#039;&amp;#039;&amp;#039; checks elements one after another until the target is found or the collection ends.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
names = [&amp;quot;Ava&amp;quot;, &amp;quot;Ben&amp;quot;, &amp;quot;Chen&amp;quot;, &amp;quot;Dina&amp;quot;]&lt;br /&gt;
target = &amp;quot;Chen&amp;quot;&lt;br /&gt;
found_index = -1&lt;br /&gt;
&lt;br /&gt;
for i in range(len(names)):&lt;br /&gt;
    if names[i] == target:&lt;br /&gt;
        found_index = i&lt;br /&gt;
        break&lt;br /&gt;
&lt;br /&gt;
print(found_index)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is 2. The special value &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; is used here to mean “not found.” Different languages and libraries use different conventions.&lt;br /&gt;
&lt;br /&gt;
For an unsorted list, linear search may need to inspect every element. If the amount of data doubles, the worst-case amount of checking also roughly doubles. This is an introduction to [[English:Computational complexity|algorithmic complexity]].&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Nested Arrays and Lists =&lt;br /&gt;
&lt;br /&gt;
A collection can contain other collections. This creates &amp;#039;&amp;#039;&amp;#039;nested&amp;#039;&amp;#039;&amp;#039; structures. A two-dimensional arrangement is useful for data organized in rows and columns, such as a game board, seating chart, spreadsheet, or small image.&lt;br /&gt;
&lt;br /&gt;
[[File:2D array diagram.svg|500px|frameless|center]]&lt;br /&gt;
&lt;br /&gt;
A Python example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
grid = [&lt;br /&gt;
    [&amp;quot;A&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;],&lt;br /&gt;
    [&amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot;],&lt;br /&gt;
    [&amp;quot;G&amp;quot;, &amp;quot;H&amp;quot;, &amp;quot;I&amp;quot;]&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
print(grid[1][2])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first index chooses row 1, which is the second row. The second index chooses position 2 in that row, which is the third element. The output is &amp;lt;code&amp;gt;F&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Traversing Rows and Columns ==&lt;br /&gt;
&lt;br /&gt;
Nested loops can visit every cell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
grid = [&lt;br /&gt;
    [2, 4, 6],&lt;br /&gt;
    [1, 3, 5]&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
for row in grid:&lt;br /&gt;
    for value in row:&lt;br /&gt;
        print(value)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The outer loop chooses one row at a time. The inner loop visits each value in the current row.&lt;br /&gt;
&lt;br /&gt;
A useful debugging technique is to trace the two loop variables separately. Ask: Which row am I in? Which value inside that row am I processing?&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Beyond Two Dimensions ==&lt;br /&gt;
&lt;br /&gt;
Arrays can have more than two dimensions. A three-dimensional structure can model layers of data, such as several 2D images, measurements across time, or a block of cells.&lt;br /&gt;
&lt;br /&gt;
[[File:3D array diagram.svg|500px|frameless|center]]&lt;br /&gt;
&lt;br /&gt;
For most school projects, one- and two-dimensional structures are enough. The important transferable idea is that each additional dimension requires another position or index to locate one value.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Choosing Between Arrays and Lists =&lt;br /&gt;
&lt;br /&gt;
There is no single structure that is best for every problem. Make your choice based on what the program needs to do.&lt;br /&gt;
&lt;br /&gt;
Use an array-like structure when positions matter, indexed access is frequent, or the amount of data is known and stable. Use a resizable list-like structure when items are added or removed often or when the final size is not known in advance.&lt;br /&gt;
&lt;br /&gt;
Before choosing, ask these questions:&lt;br /&gt;
&lt;br /&gt;
# [[English:Data modeling|Data modeling]]: Is the data naturally ordered?&lt;br /&gt;
# [[English:Index|Index]]: Do I need frequent access by position?&lt;br /&gt;
# [[English:Mutation|Mutation]]: Will the number of items change while the program runs?&lt;br /&gt;
# [[English:Traversal|Traversal]]: Will I usually process every item in sequence?&lt;br /&gt;
# [[English:Performance|Performance]]: Which operations happen most often?&lt;br /&gt;
&lt;br /&gt;
These questions are more useful than memorizing a rule such as “arrays are always better” or “lists are always easier.”&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Performance Intuition ==&lt;br /&gt;
&lt;br /&gt;
For a typical array or dynamic array, reading an element by index is usually very fast because the position can be calculated directly. A linear search through an unsorted sequence may inspect many elements. Inserting or deleting near the middle of an array-based sequence may require other elements to shift.&lt;br /&gt;
&lt;br /&gt;
A linked list has different trade-offs. Reaching the item at a given position requires following links from node to node, but inserting a node can be efficient when the program already has a reference to the correct location.&lt;br /&gt;
&lt;br /&gt;
At this level, focus on the shape of the work:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Operation&lt;br /&gt;
! Typical array-based intuition&lt;br /&gt;
! Question to ask&lt;br /&gt;
|-&lt;br /&gt;
| Read by index&lt;br /&gt;
| Very efficient&lt;br /&gt;
| Do I know the position?&lt;br /&gt;
|-&lt;br /&gt;
| Linear search&lt;br /&gt;
| Work grows with the number of elements&lt;br /&gt;
| Is the data unsorted?&lt;br /&gt;
|-&lt;br /&gt;
| Append to a dynamic array&lt;br /&gt;
| Usually efficient&lt;br /&gt;
| Can occasional resizing happen?&lt;br /&gt;
|-&lt;br /&gt;
| Insert in the middle&lt;br /&gt;
| May require shifting elements&lt;br /&gt;
| How often will this occur?&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The word &amp;#039;&amp;#039;&amp;#039;typical&amp;#039;&amp;#039;&amp;#039; matters. Exact performance depends on the language, implementation, and operation.&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|https://www.youtube.com/watch?v=tI_tIZFyKBw|500|center}}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Common Errors and Debugging =&lt;br /&gt;
&lt;br /&gt;
Collections are a common source of small but important programming mistakes. Learning to diagnose them is part of learning the structure.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Off-by-One Errors ==&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;off-by-one error&amp;#039;&amp;#039;&amp;#039; occurs when a boundary is one position too early or too late. A common example is trying to access index &amp;lt;code&amp;gt;len(items)&amp;lt;/code&amp;gt; in a zero-based list. The last valid index is &amp;lt;code&amp;gt;len(items) - 1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Wrong idea:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
items = [&amp;quot;red&amp;quot;, &amp;quot;green&amp;quot;, &amp;quot;blue&amp;quot;]&lt;br /&gt;
print(items[len(items)])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Correct final element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
items = [&amp;quot;red&amp;quot;, &amp;quot;green&amp;quot;, &amp;quot;blue&amp;quot;]&lt;br /&gt;
print(items[len(items) - 1])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A safer alternative in Python is &amp;lt;code&amp;gt;items[-1]&amp;lt;/code&amp;gt;, but remember that negative indexing is a Python feature and is not universal across programming languages.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Changing a List While Traversing It ==&lt;br /&gt;
&lt;br /&gt;
Removing items from a list while a loop is moving through that same list can cause elements to be skipped or produce confusing behavior.&lt;br /&gt;
&lt;br /&gt;
Instead of modifying the list immediately, you can often build a new filtered list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
values = [3, 8, 2, 9, 4]&lt;br /&gt;
kept = []&lt;br /&gt;
&lt;br /&gt;
for value in values:&lt;br /&gt;
    if value &amp;gt;= 5:&lt;br /&gt;
        kept.append(value)&lt;br /&gt;
&lt;br /&gt;
print(kept)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result is &amp;lt;code&amp;gt;[8, 9]&amp;lt;/code&amp;gt;. This approach separates the original input from the output and is often easier to reason about.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Aliasing and Shared References ==&lt;br /&gt;
&lt;br /&gt;
Two variables can sometimes refer to the same mutable list. Then a change made through one variable is visible through the other.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a = [1, 2, 3]&lt;br /&gt;
b = a&lt;br /&gt;
b.append(4)&lt;br /&gt;
&lt;br /&gt;
print(a)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is &amp;lt;code&amp;gt;[1, 2, 3, 4]&amp;lt;/code&amp;gt; because &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; refer to the same list object.&lt;br /&gt;
&lt;br /&gt;
If you need a separate list, create a copy using an appropriate operation for your language. This becomes especially important with nested collections, where shallow and deep copies can behave differently.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Worked Example: Class Temperature Data =&lt;br /&gt;
&lt;br /&gt;
Suppose a class records the outdoor temperature at noon for five school days:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
temperatures = [17, 19, 21, 18, 20]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You want to calculate the average and count the number of days at or above 20 degrees Celsius.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
temperatures = [17, 19, 21, 18, 20]&lt;br /&gt;
&lt;br /&gt;
total = 0&lt;br /&gt;
warm_days = 0&lt;br /&gt;
&lt;br /&gt;
for temperature in temperatures:&lt;br /&gt;
    total += temperature&lt;br /&gt;
&lt;br /&gt;
    if temperature &amp;gt;= 20:&lt;br /&gt;
        warm_days += 1&lt;br /&gt;
&lt;br /&gt;
average = total / len(temperatures)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Average:&amp;quot;, average)&lt;br /&gt;
print(&amp;quot;Warm days:&amp;quot;, warm_days)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program uses one collection and two accumulators. The loop visits every element once. The variable &amp;lt;code&amp;gt;total&amp;lt;/code&amp;gt; stores a running sum, while &amp;lt;code&amp;gt;warm_days&amp;lt;/code&amp;gt; stores a running count.&lt;br /&gt;
&lt;br /&gt;
To extend the program, you could find the highest value, record which day it occurred, or compare two weeks using a nested list.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Language Comparison =&lt;br /&gt;
&lt;br /&gt;
The same concepts appear under different names in different languages.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! Concept&lt;br /&gt;
! Python&lt;br /&gt;
! Java&lt;br /&gt;
! JavaScript&lt;br /&gt;
|-&lt;br /&gt;
| Resizable sequence&lt;br /&gt;
| &amp;lt;code&amp;gt;list&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;ArrayList&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Fixed-size basic array&lt;br /&gt;
| Not the usual built-in list model&lt;br /&gt;
| &amp;lt;code&amp;gt;type[]&amp;lt;/code&amp;gt;&lt;br /&gt;
| Use specialized structures when fixed-size behavior is required&lt;br /&gt;
|-&lt;br /&gt;
| First index&lt;br /&gt;
| Usually 0&lt;br /&gt;
| 0&lt;br /&gt;
| 0&lt;br /&gt;
|-&lt;br /&gt;
| Add to end&lt;br /&gt;
| &amp;lt;code&amp;gt;append&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;add&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;push&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Number of items&lt;br /&gt;
| &amp;lt;code&amp;gt;len&amp;lt;/code&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt; for arrays or &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; for ArrayList&lt;br /&gt;
| &amp;lt;code&amp;gt;length&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Do not memorize the syntax without understanding the operations. The transferable idea is the same: create a sequence, identify positions, traverse elements, and transform the data.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Interactive Tasks =&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Quiz: Test Your Knowledge ==&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;In a zero-based array, what is the index of the first element?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(0)&lt;br /&gt;
(!1)&lt;br /&gt;
(!2)&lt;br /&gt;
(!The length)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A zero-based list has length 6. What is its last valid index?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(5)&lt;br /&gt;
(!6)&lt;br /&gt;
(!7)&lt;br /&gt;
(!4)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What does an index identify in an array or list?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(A position of an element)&lt;br /&gt;
(!The programming language)&lt;br /&gt;
(!The total memory of the computer)&lt;br /&gt;
(!The name of every variable)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Which operation changes a value without necessarily changing the length of a list?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(Replace an element)&lt;br /&gt;
(!Append an element)&lt;br /&gt;
(!Remove an element)&lt;br /&gt;
(!Insert an element)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What does it mean to traverse a list?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(Visit its elements systematically)&lt;br /&gt;
(!Delete every element)&lt;br /&gt;
(!Rename the list)&lt;br /&gt;
(!Convert every value to text)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Which algorithm checks elements one after another for a target?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(Linear search)&lt;br /&gt;
(!Binary encoding)&lt;br /&gt;
(!Recursion tree)&lt;br /&gt;
(!Hash encryption)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What is a nested list?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(A list that contains another list)&lt;br /&gt;
(!A list with no elements)&lt;br /&gt;
(!A list that cannot change)&lt;br /&gt;
(!A list stored in a text file)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Why are off-by-one errors common with zero-based indexing?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(The final index is one less than the length)&lt;br /&gt;
(!Arrays always begin at index two)&lt;br /&gt;
(!Loops cannot access arrays)&lt;br /&gt;
(!Lists never have a length)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Which statement best describes a Python list?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(It is a mutable ordered sequence)&lt;br /&gt;
(!It is always fixed at one length)&lt;br /&gt;
(!It can store only integers)&lt;br /&gt;
(!It has no indexes)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MC}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;When might a two-dimensional collection be especially useful?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
(Modeling rows and columns)&lt;br /&gt;
(!Storing one isolated number)&lt;br /&gt;
(!Naming one variable)&lt;br /&gt;
(!Printing one fixed sentence)&lt;br /&gt;
&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Memory Game ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;memo-quiz&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Index || Position used to identify an element&lt;br /&gt;
|-&lt;br /&gt;
| Element || One item stored in a collection&lt;br /&gt;
|-&lt;br /&gt;
| Traversal || Systematic visit through a sequence&lt;br /&gt;
|-&lt;br /&gt;
| Append || Operation that adds an item to the end&lt;br /&gt;
|-&lt;br /&gt;
| Mutable || Able to be changed after creation&lt;br /&gt;
|-&lt;br /&gt;
| Nested || Containing another collection inside&lt;br /&gt;
|}&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Drag and Drop ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;lueckentext-quiz&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Match the correct terms.&lt;br /&gt;
! Topic&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Append&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Add an item to the end&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Index&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Identify an item by position&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Traverse&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Visit elements in sequence&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Filter&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Keep items that satisfy a rule&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;Replace&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| Change the value at an existing position&lt;br /&gt;
|}&lt;br /&gt;
{{E}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Crossword Puzzle ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;kreuzwort-quiz&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| Index || What word names the position used to access an item?&lt;br /&gt;
|-&lt;br /&gt;
| Element || What word names one item stored in a collection?&lt;br /&gt;
|-&lt;br /&gt;
| Iterate || What verb means to repeat a process through collection items?&lt;br /&gt;
|-&lt;br /&gt;
| Mutable || What adjective describes a collection that can be changed?&lt;br /&gt;
|-&lt;br /&gt;
| Matrix || What word often describes data arranged in rows and columns?&lt;br /&gt;
|-&lt;br /&gt;
| Bounds || What word describes the valid limits of array indexes?&lt;br /&gt;
|}&lt;br /&gt;
{{E}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== LearningApps ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;iframe&amp;gt; https://learningapps.org/index.php?s=Arrays+and+Lists &amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
== Cloze Text ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;quiz display=simple&amp;gt;&lt;br /&gt;
{&amp;#039;&amp;#039;&amp;#039;Complete the text.&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
|type=&amp;quot;{}&amp;quot;}&lt;br /&gt;
An array or list stores an ordered collection of { elements }. In many introductory languages, the first position has index { 0 }. The final valid index of a zero-based sequence is one less than its { length }. Visiting each item in a systematic order is called { traversal }. Adding an item to the end of a resizable sequence is often called { append }. A collection inside another collection is described as { nested }. A search that checks items one by one is a { linear search }. An error caused by using a boundary one position too early or too late is an { off-by-one error }.&lt;br /&gt;
&amp;lt;/quiz&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Open-Ended Tasks =&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
=== Easy ===&lt;br /&gt;
# [[English:Indexing poster|Indexing poster]]: Create a one-page visual poster that shows a five-item list with its zero-based indexes, then add two examples of correct element access.&lt;br /&gt;
# [[English:Trace table|Trace table]]: Write a trace table for a loop that adds the values in a short list and explain how the accumulator changes after each iteration.&lt;br /&gt;
# [[English:Mini list program|Mini list program]]: Create a small program that stores five favorite books, games, foods, or places in a list and prints the first, middle, and last items.&lt;br /&gt;
# [[English:Teach indexing on video|Teach indexing on video]]: Record a short video in which you explain zero-based indexing to a classmate using a real-world row of objects as your model.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
=== Standard ===&lt;br /&gt;
# [[English:Debugging investigation|Debugging investigation]]: Create three short code examples with index errors, diagnose each problem, and write a corrected version with an explanation.&lt;br /&gt;
# [[English:Class survey dataset|Class survey dataset]]: Conduct a small class survey with permission, store the non-sensitive responses in a list, and write a program that counts or summarizes the results.&lt;br /&gt;
# [[English:Collection interview|Collection interview]]: Interview a teacher, technician, librarian, or another adult about a task that involves ordered data, then describe how an array or list could model that data.&lt;br /&gt;
# [[English:Grid project|Grid project]]: Build a two-dimensional list that represents a seating plan, game board, pixel pattern, or timetable and write code that reads and changes selected cells.&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
=== Advanced ===&lt;br /&gt;
# [[English:Search experiment|Search experiment]]: Create lists of different lengths, run a linear search for targets near the beginning and end, record the number of comparisons, and explain the pattern you observe.&lt;br /&gt;
# [[English:Language comparison report|Language comparison report]]: Compare array or list operations in two programming languages and write a short report showing similarities, differences, and one potential source of confusion.&lt;br /&gt;
# [[English:Real-world collection model|Real-world collection model]]: Visit a suitable place such as a school library, computer lab, workshop, or sports area and design a data model that represents one ordered collection you observe without collecting personal data.&lt;br /&gt;
# [[English:Data explainer project|Data explainer project]]: Produce an illustrated article or video that teaches when to use a one-dimensional list, a two-dimensional collection, and a resizable sequence, including original examples and code.&lt;br /&gt;
&lt;br /&gt;
{{:Open Task - Create a MOOC}}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Learning Assessment =&lt;br /&gt;
&lt;br /&gt;
# [[English:Trace and justify|Trace and justify]]: Trace a program that updates several list elements, state the final list, and justify each change by referring to indexes and operations.&lt;br /&gt;
# [[English:Design a solution|Design a solution]]: Choose an appropriate array or list representation for a school-related dataset and explain why the structure fits the required operations.&lt;br /&gt;
# [[English:Debug and transfer|Debug and transfer]]: Repair a program with an invalid index and then explain how the same error could appear in a different programming language.&lt;br /&gt;
# [[English:Algorithm comparison|Algorithm comparison]]: Compare two ways to find a value in a collection and reason about which method is suitable for an unsorted dataset.&lt;br /&gt;
# [[English:Nested data reasoning|Nested data reasoning]]: Given a small two-dimensional collection, identify several values by row and column and write code that visits every element.&lt;br /&gt;
# [[English:Mutation analysis|Mutation analysis]]: Explain the difference between replacing an element, appending an element, and removing an element, then predict how each operation changes length and indexes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Evidence of Learning =&lt;br /&gt;
&lt;br /&gt;
Strong evidence of learning includes both understanding and practical performance.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Area&lt;br /&gt;
! Evidence&lt;br /&gt;
|-&lt;br /&gt;
| Knowledge&lt;br /&gt;
| You can explain element, index, length, traversal, mutation, nesting, and linear search in your own words.&lt;br /&gt;
|-&lt;br /&gt;
| Skills&lt;br /&gt;
| You can access, update, append, remove, traverse, filter, and search sequence data with correct index logic.&lt;br /&gt;
|-&lt;br /&gt;
| Products&lt;br /&gt;
| You can create trace tables, working programs, diagrams, short explanations, and a small data-modeling project.&lt;br /&gt;
|-&lt;br /&gt;
| Reasoning&lt;br /&gt;
| You can predict the result of code before running it and explain why an index or boundary is valid or invalid.&lt;br /&gt;
|-&lt;br /&gt;
| Transfer&lt;br /&gt;
| You can recognize arrays and lists across more than one programming language and adapt the same algorithmic idea to different syntax.&lt;br /&gt;
|-&lt;br /&gt;
| Reflection&lt;br /&gt;
| You can identify an error in your own approach, describe how you found it, and explain how you would prevent it in future work.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= OERs on the Topic =&lt;br /&gt;
&lt;br /&gt;
The following English Wikipedia article provides additional background on arrays as data structures:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;iframe&amp;gt; https://en.m.wikipedia.org/wiki/Array_(data_structure) &amp;lt;/iframe&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also explore [[English:List (abstract data type)|lists]], [[English:Linked list|linked lists]], [[English:Dynamic array|dynamic arrays]], [[English:Linear search|linear search]], and [[English:Computational complexity|computational complexity]] as connected topics.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= Linked Learning Areas =&lt;br /&gt;
&lt;br /&gt;
The central ideas of this course connect data organization with algorithms, programming language syntax, debugging, and real-world modeling.&lt;br /&gt;
&lt;br /&gt;
{| align=center&lt;br /&gt;
{{:D-Tab}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[English:Arrays and Lists|Arrays and Lists]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# [[English:Array (data structure)|Arrays]]&lt;br /&gt;
# [[English:List (abstract data type)|Lists]]&lt;br /&gt;
# [[English:Indexing|Indexing]]&lt;br /&gt;
# [[English:Iteration|Iteration]]&lt;br /&gt;
# [[English:Linear search|Linear search]]&lt;br /&gt;
# [[English:Two-dimensional array|Two-dimensional arrays]]&lt;br /&gt;
# [[English:Data structure|Data structures]]&lt;br /&gt;
# [[English:Algorithm|Algorithms]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{BR}}&lt;br /&gt;
= aiMOOC Projects =&lt;br /&gt;
[[Category:English]]&lt;br /&gt;
[[Category:Arrays and Lists]]&lt;br /&gt;
[[Category:Computer Science]]&lt;br /&gt;
[[Category:Programming]]&lt;br /&gt;
[[Category:Data Structures]]&lt;br /&gt;
[[Category:Algorithms]]&lt;br /&gt;
[[Category:Grades 9-10]]&lt;br /&gt;
[[Category:Secondary Education]]&lt;br /&gt;
[[Category:AI_MOOC]]&lt;br /&gt;
[[Category:GPT aiMOOC]]&lt;br /&gt;
{{MT}}&lt;/div&gt;</summary>
		<author><name>Glanz</name></author>
	</entry>
</feed>