Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

This is CS50.

This is CS50.

computational thinking
inputs algorithms outputs

computational thinking
inputs algorithms outputs

computational thinking
inputs algorithms outputs

andexdesign.com

1
2
3
4
5
6
7
8
9
10
11
12
13

pick up phone book


open to middle of phone book
look at names
if "Smith" is among names
call Mike
else if "Smith" is earlier in book
open to middle of left half of book
go to line 3
else if "Smith" is later in book
open to middle of right half of book
go to line 3
else
give up

n/2

time to solve

log n

size of problem

stand up and assign yourself the number 1

pair off with someone standing,


add your numbers together,
and adopt the sum as your new number

one of you should sit down;


the other should go back to step 2

n/2

time to solve

log n

size of problem

source pseudocode

source code

source source code

#include <stdio.h>
int main(void)
{
printf("hello, world\n");
}

statements

statements

statements

Boolean expressions

Boolean expressions

Boolean expressions

Boolean expressions

conditions

conditions

conditions

loops

loops

variables

arrays

functions

threads

events

This is CS50.

You might also like