CS111 - Lecture Note 05
CS111 - Lecture Note 05
Computing
(CS111)
Junar A. Landicho
junarlandicho@ustp.edu.ph
“
Motivation is what gets
you started. Habit is what
keeps you going.”
Jim Ryun
Topic 5:
Algorithms
IT 416
Information Systems Development and Management
Learning Outcomes
By the end of this topic, students will be able to:
Apply a creative development process when creating
computational artifacts.
Develop an algorithm for implementation in a program.
Express an algorithm in a language.
Evaluate algorithms analytically and empirically for efficiency,
correctness, and clarity.
Python
Java
PHP
A Terminating Process
▪ Culminates with a result
▪ Can include systems that run
continuously (Hospital systems, Long
Division Algorithm)
A Non-terminating Process
▪ Does not produce an answer
Python
Java
PHP
Origami primitives
def Greetings():
Count = 3
while (Count > 0):
print('Hello')
Count = Count - 1
Using parameters
def Sort(List):
.
.
Executing Sort on different lists
Sort(the membership list)
Sort(the wedding guest list)
Python
Java
PHP
Python
Java
PHP
Pretest loop:
while (condition):
body
Posttest loop:
repeat:
body
until(condition)
Python
Java
PHP
Python
Java
PHP