Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Problem Solving with Algorithms and Data Struct...

Avatar for Bruce Tsai Bruce Tsai
February 02, 2015

Problem Solving with Algorithms and Data Structures

Avatar for Bruce Tsai

Bruce Tsai

February 02, 2015
Tweet

More Decks by Bruce Tsai

Other Decks in Programming

Transcript

  1. Problem-solving • Human • Time consuming • Computer • Efficiency

    • Reuse • Communication tool • Program • Method and Data • Mathematical model • Input/Output
  2. Python Data Type • int • float • bool •

    weak type • dynamic strongly type
  3. Python Collection • List [] • ordered • duplicate elements

    • mutable • compound data • Tuple () • ordered • duplicate elements • immutable • heterogeneous data
  4. Python Collection • Set {}, set() • unordered • no

    duplicate elements • mutable • heterogeneous data • Dictionary { key: value} • key-value pair • no duplicate keys • mutable • heterogeneous data
  5. Python String • “” or ‘’ • ordered • duplicate

    elements • immutable • homogeneous
  6. Python Control Structure • while • execute code repeatedly based

    on given condition • for • allow code to repeatedly executed • if, elif, else • perform different computations depending on condition
  7. Exception • Syntax error • Logical error (runtime error) •

    Exception • prevent program to terminate from runtime error