Ice breaker: do you eat leftover pizza hot or cold? (3/4 eat cold)
Create a Notion page at the bottom of this page for your group (if you haven’t already), and spend a few minutes playing around with Notion features.
Complete the following activities. You can copy the questions into your own page, but if you do, try to have your answers in a different color.
let x:i32 = 12;
// infinitely prints "the"
for(int i=1; i>0; i++) {
System.out.println("the");
}
print("Hello World")
$$ x^2 − 4 = 0. $$
@Lian Duan
What is an algorithm? A set of instructions to give an output from a given input.
Algorithm examples: bfs, dfs, merge sort, binary sort
Pseudocode: Going line for line of code in layman’s terms
[24 | 21 | 55 | 8 | 76 | 6 | 2 | 66 | 50 | 82]
Algorithm InsertionSort(dataList)
// dataList is a zero-indexed list/array of sortable data
// n is the length of dataList
// algorithm modifies the dataList; returns the modified list
for i = 1 to n-1 do
let j = i
while j > 0 and dataList[j] < dataList[j-1] do
swap dataList[j] and dataList[j-1]
let j = j - 1
return dataList