1 / 15

computer science

CSCI 1001. overview of. computer science. ALGORITHMS. what is computer science?. Computer Science. The study of algorithms , including Formal and mathematical properties Hardware realizations Software realizations Applications. Algorithm. A sequence of steps that will always produce

denise
Download Presentation

computer science

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCI 1001 overview of computer science ALGORITHMS

  2. what is computer science?

  3. Computer Science The study of algorithms, including • Formal and mathematical properties • Hardware realizations • Software realizations • Applications

  4. Algorithm A sequence of steps that will always produce the same results from the same starting point.

  5. Sequential operations are executed by an agent one after another. set a variable to a value get input from a user print output to a user stop executing

  6. Conditional operations decide what to do next based on the answer to a yes/no question. if (question) then: more operations if (question) then: more operations else: other operations

  7. Iterative operations repeat a sequence of operations. Go back to a step for every value in a list: do some operations while (the answer to a question is yes): do some operations

  8. Algorithm “A well-ordered collection of unambiguous and effectively computable operations that, when executed, produces a result and halts in a finite amount of time.”

  9. Input:two positive integers, x and y • Output: an integer, z • set z=0 • while (x > 0): • set z = z+y • set x = x-1 • stop and output z

  10. Input:a list of ages, {age1,age2,…,agek} Output: an integer, count • set count=0 • for every a ∈{age1,…,agek}: • if (a ≥ 21): • set count = count+1 • stop and output count

  11. Input:two lists of friends, {alice1,…,alicek} and {bob1,…,bobm} Output: yes or no. • for every a ∈{alice1,…,alicek}: • for every b ∈ {bob1,…,bobm}: • if (a = b) then: • stop and output yes • stop and output no

  12. why look for algorithms?

  13. when is it hard to find an algorithm?

  14. http://cs1001.us/ Please read Chapter 4.2.1 for Monday’s lecture.

More Related