Submit Search
Upload
CS50 Lecture2
•
0 likes
•
1,652 views
昀
昀 李
Follow
This is the CS50 lecture 2. Harvard All Rights Reserved.
Read less
Read more
Software
Report
Share
Report
Share
1 of 127
Download now
Download to read offline
Recommended
CS50 Lecture1
CS50 Lecture1
昀 李
Week1m
Week1m
tauqeer729
Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)
hasan0812
A simple snake game project
A simple snake game project
Amit Kumar
Blocks+gcd入門
Blocks+gcd入門
領一 和泉田
Laziness in Swift
Laziness in Swift
SwiftWro
preventing sqli and xss by ravi rajput in owasp meet ahmedabad
preventing sqli and xss by ravi rajput in owasp meet ahmedabad
Ravi Rajput
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
James Titcumb
Recommended
CS50 Lecture1
CS50 Lecture1
昀 李
Week1m
Week1m
tauqeer729
Hangman Game Programming in C (coding)
Hangman Game Programming in C (coding)
hasan0812
A simple snake game project
A simple snake game project
Amit Kumar
Blocks+gcd入門
Blocks+gcd入門
領一 和泉田
Laziness in Swift
Laziness in Swift
SwiftWro
preventing sqli and xss by ravi rajput in owasp meet ahmedabad
preventing sqli and xss by ravi rajput in owasp meet ahmedabad
Ravi Rajput
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
James Titcumb
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
James Titcumb
Wx::Perl::Smart
Wx::Perl::Smart
lichtkind
Intro to OAuth
Intro to OAuth
mfrost503
07 php
07 php
CBRIARCSC
[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?
Radek Benkel
c++ program for Canteen management
c++ program for Canteen management
Swarup Kumar Boro
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6
Andrew Shitov
2013 28-03-dak-why-fp
2013 28-03-dak-why-fp
Dmitriy Kiriyenko
Python 炒股指南
Python 炒股指南
Leo Zhou
Answer unit4.4.1
Answer unit4.4.1
KwanJai Cherubstar
Dip Your Toes in the Sea of Security (PHP MiNDS January Meetup 2016)
Dip Your Toes in the Sea of Security (PHP MiNDS January Meetup 2016)
James Titcumb
Perl6 grammars
Perl6 grammars
Andrew Shitov
Codigos
Codigos
Manuel Valero
Interpret this... (PHPem 2016)
Interpret this... (PHPem 2016)
James Titcumb
Linux shell script-1
Linux shell script-1
兎 伊藤
Introduction to Programming @ NTHUEEECamp 2015
Introduction to Programming @ NTHUEEECamp 2015
淳佑 楊
An Introduction to PHP... and Why It's Yucky!
An Introduction to PHP... and Why It's Yucky!
Jorge Silva Jetter
The Perl6 Type System
The Perl6 Type System
abrummett
The Future of JavaScript (SXSW '07)
The Future of JavaScript (SXSW '07)
Aaron Gustafson
Top 10 php classic traps php serbia
Top 10 php classic traps php serbia
Damien Seguy
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptx
rawdnsr
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptx
rawdnsr
More Related Content
What's hot
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
James Titcumb
Wx::Perl::Smart
Wx::Perl::Smart
lichtkind
Intro to OAuth
Intro to OAuth
mfrost503
07 php
07 php
CBRIARCSC
[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?
Radek Benkel
c++ program for Canteen management
c++ program for Canteen management
Swarup Kumar Boro
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6
Andrew Shitov
2013 28-03-dak-why-fp
2013 28-03-dak-why-fp
Dmitriy Kiriyenko
Python 炒股指南
Python 炒股指南
Leo Zhou
Answer unit4.4.1
Answer unit4.4.1
KwanJai Cherubstar
Dip Your Toes in the Sea of Security (PHP MiNDS January Meetup 2016)
Dip Your Toes in the Sea of Security (PHP MiNDS January Meetup 2016)
James Titcumb
Perl6 grammars
Perl6 grammars
Andrew Shitov
Codigos
Codigos
Manuel Valero
Interpret this... (PHPem 2016)
Interpret this... (PHPem 2016)
James Titcumb
Linux shell script-1
Linux shell script-1
兎 伊藤
Introduction to Programming @ NTHUEEECamp 2015
Introduction to Programming @ NTHUEEECamp 2015
淳佑 楊
An Introduction to PHP... and Why It's Yucky!
An Introduction to PHP... and Why It's Yucky!
Jorge Silva Jetter
The Perl6 Type System
The Perl6 Type System
abrummett
The Future of JavaScript (SXSW '07)
The Future of JavaScript (SXSW '07)
Aaron Gustafson
Top 10 php classic traps php serbia
Top 10 php classic traps php serbia
Damien Seguy
What's hot
(20)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Dip Your Toes in the Sea of Security (PHP South Africa 2017)
Wx::Perl::Smart
Wx::Perl::Smart
Intro to OAuth
Intro to OAuth
07 php
07 php
[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?
c++ program for Canteen management
c++ program for Canteen management
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6
2013 28-03-dak-why-fp
2013 28-03-dak-why-fp
Python 炒股指南
Python 炒股指南
Answer unit4.4.1
Answer unit4.4.1
Dip Your Toes in the Sea of Security (PHP MiNDS January Meetup 2016)
Dip Your Toes in the Sea of Security (PHP MiNDS January Meetup 2016)
Perl6 grammars
Perl6 grammars
Codigos
Codigos
Interpret this... (PHPem 2016)
Interpret this... (PHPem 2016)
Linux shell script-1
Linux shell script-1
Introduction to Programming @ NTHUEEECamp 2015
Introduction to Programming @ NTHUEEECamp 2015
An Introduction to PHP... and Why It's Yucky!
An Introduction to PHP... and Why It's Yucky!
The Perl6 Type System
The Perl6 Type System
The Future of JavaScript (SXSW '07)
The Future of JavaScript (SXSW '07)
Top 10 php classic traps php serbia
Top 10 php classic traps php serbia
Similar to CS50 Lecture2
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptx
rawdnsr
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptx
rawdnsr
CS50 Lecture3
CS50 Lecture3
昀 李
C programms
C programms
Mukund Gandrakota
06 1 조건문
06 1 조건문
Changwon National University
String
String
SANTOSH RATH
Tu1
Tu1
Ediga Venkigowd
Tips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET Application
Joni
C++ Programming - 1st Study
C++ Programming - 1st Study
Chris Ohk
Defcon 23 - Daniel Selifonov - drinking from LETHE
Defcon 23 - Daniel Selifonov - drinking from LETHE
Felipe Prado
String Manipulation Function and Header File Functions
String Manipulation Function and Header File Functions
Bosco Technical Training Society, Don Bosco Technical School (Aff. GGSIP University, New Delhi)
Strings in C
Strings in C
Aditya Nihal Kumar Singh
Java Unicode with Cool GUI Examples
Java Unicode with Cool GUI Examples
OXUS 20
Java Unicode with Live GUI Examples
Java Unicode with Live GUI Examples
Abdul Rahman Sherzad
Programming ppt files (final)
Programming ppt files (final)
yap_raiza
Decision making and branching
Decision making and branching
Saranya saran
5 c control statements looping
5 c control statements looping
MomenMostafa
string , pointer
string , pointer
Arafat Bin Reza
Student teacher database management
Student teacher database management
dharmenderlodhi021
4. chapter iii
4. chapter iii
Chhom Karath
Similar to CS50 Lecture2
(20)
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 2022 - Lecture 2 - Arrays.pptx
CS50 Lecture3
CS50 Lecture3
C programms
C programms
06 1 조건문
06 1 조건문
String
String
Tu1
Tu1
Tips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET Application
C++ Programming - 1st Study
C++ Programming - 1st Study
Defcon 23 - Daniel Selifonov - drinking from LETHE
Defcon 23 - Daniel Selifonov - drinking from LETHE
String Manipulation Function and Header File Functions
String Manipulation Function and Header File Functions
Strings in C
Strings in C
Java Unicode with Cool GUI Examples
Java Unicode with Cool GUI Examples
Java Unicode with Live GUI Examples
Java Unicode with Live GUI Examples
Programming ppt files (final)
Programming ppt files (final)
Decision making and branching
Decision making and branching
5 c control statements looping
5 c control statements looping
string , pointer
string , pointer
Student teacher database management
Student teacher database management
4. chapter iii
4. chapter iii
Recently uploaded
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
VitsRangannavar
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
Tier1 app
Asset Management Software - Infographic
Asset Management Software - Infographic
Hr365.us smith
What is Binary Language? Computer Number Systems
What is Binary Language? Computer Number Systems
JheuzeDellosa
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
stazi3110
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
joe51371421
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
Power Karaoke
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
Wave PLM
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
Fatema Valibhai
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Alberto González Trastoy
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio, Inc.
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
kalichargn70th171
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
kalichargn70th171
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
aditisharan08
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
BradBedford3
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
AxelRicardoTrocheRiq
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
Ortus Solutions, Corp
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ICS
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
Neo4j
Recently uploaded
(20)
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
Asset Management Software - Infographic
Asset Management Software - Infographic
What is Binary Language? Computer Number Systems
What is Binary Language? Computer Number Systems
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
CS50 Lecture2
1.
This is CS50
2.
3.
This is CS50
4.
5.
#include <stdio.h> int main(void) { printf("hello,
worldn"); }
6.
#include <stdio.h> int main(void) { printf("hello,
worldn"); }
7.
#include <stdio.h> int main(void) { printf("hello,
worldn"); }
8.
01111111 01000101 01001100
01000110 00000010 00000001 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000010 00000000 00111110 00000000 00000001 00000000 00000000 00000000 10110000 00000101 01000000 00000000 00000000 00000000 00000000 00000000 01000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11010000 00010011 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 01000000 00000000 00111000 00000000 00001001 00000000 01000000 00000000 00100100 00000000 00100001 00000000 00000110 00000000 00000000 00000000 00000101 00000000 00000000 00000000 01000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 01000000 00000000 01000000 00000000 00000000 00000000 00000000 00000000 01000000 00000000 01000000 00000000 00000000 00000000 00000000 00000000 11111000 00000001 00000000 00000000 00000000 00000000 00000000 00000000 11111000 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00001000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000011 00000000 00000000 00000000 00000100 00000000 00000000 00000000 00111000 00000010 00000000 00000000 00000000 00000000 00000000 00000000 ...
9.
clang hello.c ./a.out
10.
clang -o hello
hello.c ./hello
11.
make hello ./hello
12.
#include <stdio.h> int main(void) { printf("hello,
worldn"); }
13.
#include <cs50.h> #include <stdio.h> int
main(void) { string name = get_string("Name: "); printf("hello, %sn", name); }
14.
clang hello.c ./a.out
15.
clang hello.c -lcs50 ./a.out
16.
clang -o hello
hello.c -lcs50 ./hello
17.
make hello ./hello
18.
compiling
19.
preprocessing compiling assembling linking
20.
preprocessing compiling assembling linking
21.
#include <cs50.h> #include <stdio.h> int
main(void) { string name = get_string("Name: "); printf("hello, %sn", name); }
22.
#include <cs50.h> #include <stdio.h> int
main(void) { string name = get_string("Name: "); printf("hello, %sn", name); }
23.
string get_string(string prompt); #include
<stdio.h> int main(void) { string name = get_string("Name: "); printf("hello, %sn", name); }
24.
string get_string(string prompt); #include
<stdio.h> int main(void) { string name = get_string("Name: "); printf("hello, %sn", name); }
25.
string get_string(string prompt); int
printf(const char *format, ...); int main(void) { string name = get_string("Name: "); printf("hello, %sn", name); }
26.
... string get_string(string prompt); int
printf(const char *format, ...); ... int main(void) { string name = get_string("Name: "); printf("hello, %sn", name); }
27.
preprocessing compiling assembling linking
28.
... string get_string(string prompt); int
printf(const char *format, ...); ... int main(void) { string name = get_string("Name: "); printf("hello, %sn", name); }
29.
... main: # @main .cfi_startproc #
BB#0: pushq %rbp .Ltmp0: .cfi_def_cfa_offset 16 .Ltmp1: .cfi_offset %rbp, -16 movq %rsp, %rbp .Ltmp2: .cfi_def_cfa_register %rbp subq $16, %rsp xorl %eax, %eax movl %eax, %edi movabsq $.L.str, %rsi movb $0, %al callq get_string movabsq $.L.str.1, %rdi movq %rax, -8(%rbp) movq -8(%rbp), %rsi movb $0, %al callq printf ...
30.
... main: # @main .cfi_startproc #
BB#0: pushq %rbp .Ltmp0: .cfi_def_cfa_offset 16 .Ltmp1: .cfi_offset %rbp, -16 movq %rsp, %rbp .Ltmp2: .cfi_def_cfa_register %rbp subq $16, %rsp xorl %eax, %eax movl %eax, %edi movabsq $.L.str, %rsi movb $0, %al callq get_string movabsq $.L.str.1, %rdi movq %rax, -8(%rbp) movq -8(%rbp), %rsi movb $0, %al callq printf ...
31.
... main: # @main .cfi_startproc #
BB#0: pushq %rbp .Ltmp0: .cfi_def_cfa_offset 16 .Ltmp1: .cfi_offset %rbp, -16 movq %rsp, %rbp .Ltmp2: .cfi_def_cfa_register %rbp subq $16, %rsp xorl %eax, %eax movl %eax, %edi movabsq $.L.str, %rsi movb $0, %al callq get_string movabsq $.L.str.1, %rdi movq %rax, -8(%rbp) movq -8(%rbp), %rsi movb $0, %al callq printf ...
32.
33.
preprocessing compiling assembling linking
34.
... main: # @main .cfi_startproc #
BB#0: pushq %rbp .Ltmp0: .cfi_def_cfa_offset 16 .Ltmp1: .cfi_offset %rbp, -16 movq %rsp, %rbp .Ltmp2: .cfi_def_cfa_register %rbp subq $16, %rsp xorl %eax, %eax movl %eax, %edi movabsq $.L.str, %rsi movb $0, %al callq get_string movabsq $.L.str.1, %rdi movq %rax, -8(%rbp) movq -8(%rbp), %rsi movb $0, %al callq printf ...
35.
01111111010001010100110001000110 00000010000000010000000100000000 00000000000000000000000000000000 00000000000000000000000000000000 00000001000000000011111000000000 00000001000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 10100000000000100000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 01000000000000000000000000000000 00000000000000000100000000000000 00001010000000000000000100000000 01010101010010001000100111100101 01001000100000111110110000010000 00110001110000001000100111000111 01001000101111100000000000000000 00000000000000000000000000000000 00000000000000001011000000000000 11101000000000000000000000000000 00000000010010001011111100000000 00000000000000000000000000000000 00000000000000000000000001001000 ...
36.
preprocessing compiling assembling linking
37.
hello.c
38.
hello.c cs50.c
39.
hello.c cs50.c stdio.c
40.
hello.c cs50.c printf.c
41.
01111111010001010100110001000110 00000010000000010000000100000000 00000000000000000000000000000000 00000000000000000000000000000000 00000001000000000011111000000000 00000001000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 10100000000000100000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 01000000000000000000000000000000 00000000000000000100000000000000 00001010000000000000000100000000 01010101010010001000100111100101 01001000100000111110110000010000 00110001110000001000100111000111 01001000101111100000000000000000 00000000000000000000000000000000 00000000000000001011000000000000 11101000000000000000000000000000 00000000010010001011111100000000 00000000000000000000000000000000 00000000000000000000000001001000 ... cs50.c printf.c
42.
01111111010001010100110001000110 00000010000000010000000100000000 00000000000000000000000000000000 00000000000000000000000000000000 00000001000000000011111000000000 00000001000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 10100000000000100000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 01000000000000000000000000000000 00000000000000000100000000000000 00001010000000000000000100000000 01010101010010001000100111100101 01001000100000111110110000010000 00110001110000001000100111000111 01001000101111100000000000000000 00000000000000000000000000000000 00000000000000001011000000000000 11101000000000000000000000000000 00000000010010001011111100000000 00000000000000000000000000000000 00000000000000000000000001001000 ... 01111111010001010100110001000110 00000010000000010000000100000000 00000000000000000000000000000000 00000000000000000000000000000000 00000011000000000011111000000000 00000001000000000000000000000000 11000000000011110000000000000000 00000000000000000000000000000000 01000000000000000000000000000000 00000000000000000000000000000000 00101000001100100000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 01000000000000000011100000000000 00000111000000000100000000000000 00011100000000000001100100000000 00000001000000000000000000000000 00000101000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 01011100001001010000000000000000 00000000000000000000000000000000 ... printf.c
43.
01111111010001010100110001000110 00000010000000010000000100000000 00000000000000000000000000000000 00000000000000000000000000000000 00000001000000000011111000000000 00000001000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 10100000000000100000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 01000000000000000000000000000000 00000000000000000100000000000000 00001010000000000000000100000000 01010101010010001000100111100101 01001000100000111110110000010000 00110001110000001000100111000111 01001000101111100000000000000000 00000000000000000000000000000000 00000000000000001011000000000000 11101000000000000000000000000000 00000000010010001011111100000000 00000000000000000000000000000000 00000000000000000000000001001000 ... 01111111010001010100110001000110 00000010000000010000000100000000 00000000000000000000000000000000 00000000000000000000000000000000 00000011000000000011111000000000 00000001000000000000000000000000 11000000000011110000000000000000 00000000000000000000000000000000 01000000000000000000000000000000 00000000000000000000000000000000 00101000001100100000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 01000000000000000011100000000000 00000111000000000100000000000000 00011100000000000001100100000000 00000001000000000000000000000000 00000101000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 00000000000000000000000000000000 01011100001001010000000000000000 00000000000000000000000000000000 ... 00101111011011000110100101100010 01100011001011100111001101101111 00101110001101100010000000101111 01110101011100110111001000101111 01101100011010010110001000101111 01111000001110000011011001011111 00110110001101000010110101101100 01101001011011100111010101111000 00101101011001110110111001110101 00101111011011000110100101100010 01100011010111110110111001101111 01101110011100110110100001100001 01110010011001010110010000101110 01100001001000000010000001000001 01010011010111110100111001000101 01000101010001000100010101000100 00100000001010000010000000101111 01101100011010010110001000101111 01111000001110000011011001011111 00110110001101000010110101101100 01101001011011100111010101111000 00101101011001110110111001110101 00101111011011000110010000101101 01101100011010010110111001110101 01111000001011010111100000111000 00110110001011010011011000110100 ...
44.
011111110100010101001100010001100000001000000001000000010000000000000000000000000000000000000000000000 000000000000000000000000000000000100000000001111100000000000000001000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000001010000000000010000000000000000000000000000000000000000000000000000000000000000000000000 000000000100000000000000000000000000000000000000000000000100000000000000000010100000000000000001000000 000101010101001000100010011110010101001000100000111110110000010000001100011100000010001001110001110100 100010111110000000000000000000000000000000000000000000000000000000000000000010110000000000001110100000 000000000000000000000000000000010010001011111100000000000000000000000000000000000000000000000000000000 0000000001001000...01111111010001010100110001000110000000100000000100000001000000000000000000000000000 000000000000000000000000000000000000000000000000000110000000000111110000000000000000100000000000000000 000000011000000000011110000000000000000000000000000000000000000000000000100000000000000000000000000000 000000000000000000000000000000000001010000011001000000000000000000000000000000000000000000000000000000 000000000000000000000000000010000000000000000111000000000000000011100000000010000000000000000011100000 000000001100100000000000000010000000000000000000000000000010100000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000001011100001001010000000000000 00000000000000000000000000000000000...0010111101101100011010010110001001100011001011100111001101101111 001011100011011000100000001011110111010101110011011100100010111101101100011010010110001000101111011110 000011100000110110010111110011011000110100001011010110110001101001011011100111010101111000001011010110 011101101110011101010010111101101100011010010110001001100011010111110110111001101111011011100111001101 101000011000010111001001100101011001000010111001100001001000000010000001000001010100110101111101001110 010001010100010101000100010001010100010000100000001010000010000000101111011011000110100101100010001011 110111100000111000001101100101111100110110001101000010110101101100011010010110111001110101011110000010 110101100111011011100111010100101111011011000110010000101101011011000110100101101110011101010111100000 101101011110000011100000110110001011010011011000110100...
45.
46.
help50 printf style50
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
array
58.
string
59.
input → →
output
60.
plaintext → →
ciphertext
61.
H I !
62.
72 73 33
63.
64.
65.
66.
plaintext → →
ciphertext
67.
plaintext → →
ciphertext key →
68.
plaintext → →
ciphertext 1 →
69.
I L O
V E Y O U
70.
73 L O
V E Y O U
71.
73 76 O
V E Y O U
72.
73 76 79
V E Y O U
73.
73 76 79
86 E Y O U
74.
73 76 79
86 69 Y O U
75.
73 76 79
86 69 89 O U
76.
73 76 79
86 69 89 79 U
77.
73 76 79
86 69 89 79 85
78.
74 76 79
86 69 89 79 85
79.
74 77 79
86 69 89 79 85
80.
74 77 80
86 69 89 79 85
81.
74 77 80
87 69 89 79 85
82.
74 77 80
87 70 89 79 85
83.
74 77 80
87 70 90 79 85
84.
74 77 80
87 70 90 80 85
85.
74 77 80
87 70 90 80 86
86.
J 77 80
87 70 90 80 86
87.
J M 80
87 70 90 80 86
88.
J M P
87 70 90 80 86
89.
J M P
W 70 90 80 86
90.
J M P
W F 90 80 86
91.
J M P
W F Z 80 86
92.
J M P
W F Z P 86
93.
J M P
W F Z P V
94.
#include <stdio.h> int main(void) { ... }
95.
#include <stdio.h> int main(void) { ... }
96.
#include <stdio.h> int main(int
argc, string argv[]) { ... }
97.
#include <stdio.h> int main(int
argc, string argv[]) { ... }
98.
#include <stdio.h> int main(int
argc, string argv[]) { ... }
99.
#include <stdio.h> int main(void) { ... }
100.
101.
102.
103.
Bubble Sort
104.
repeat until no
swaps for i from 0 to n-2 if i'th and i+1'th elements out of order swap them
105.
Selection Sort
106.
for i from
0 to n-1 find smallest element between i'th and n-1'th swap smallest with i'th element
107.
(n – 1)
108.
(n – 1)
+ (n – 2)
109.
(n – 1)
+ (n – 2) + ... + 1
110.
(n – 1)
+ (n – 2) + ... + 1 n(n – 1)/2
111.
(n – 1)
+ (n – 2) + ... + 1 n(n – 1)/2 (n2 – n)/2
112.
(n – 1)
+ (n – 2) + ... + 1 n(n – 1)/2 (n2 – n)/2 n2 /2 – n/2
113.
(n – 1)
+ (n – 2) + ... + 1 n(n – 1)/2 (n2 – n)/2 n2 /2 – n/2 O(n2 )
114.
n2 /2 – n/2
115.
n2 /2 – n/2 1,000,0002 /2
– 1,000,000/2
116.
n2 /2 – n/2 1,000,0002 /2
– 1,000,000/2 500,000,000,000 – 500,000
117.
n2 /2 – n/2 1,000,0002 /2
– 1,000,000/2 500,000,000,000 – 500,000 499,999,500,000
118.
n2 /2 – n/2 1,000,0002 /2
– 1,000,000/2 500,000,000,000 – 500,000 499,999,500,000 O(n2 )
119.
O(n2 ) O(n log n) O(n) O(log
n) O(1)
120.
121.
O(n) O(log n)
122.
Ω(n2 ) Ω(n log n) Ω(n) Ω(log
n) Ω(1)
123.
Θ(n2 ) Θ(n log n) Θ(n) Θ(log
n) Θ(1)
124.
Merge Sort
125.
on input of
n elements if n < 2 return else sort left half of elements sort right half of elements merge sorted halves
126.
127.
This is CS50
Download now