0% found this document useful (0 votes)
64 views40 pages

2015 Fall Lectures 0 F Week0f PDF

This document introduces the concepts of computational thinking and algorithms. It discusses using inputs and algorithms to produce outputs. It also provides pseudocode examples of algorithms to search a phone book and for a divide and conquer sorting algorithm.

Uploaded by

Meghna Ashok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views40 pages

2015 Fall Lectures 0 F Week0f PDF

This document introduces the concepts of computational thinking and algorithms. It discusses using inputs and algorithms to produce outputs. It also provides pseudocode examples of algorithms to search a phone book and for a divide and conquer sorting algorithm.

Uploaded by

Meghna Ashok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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