CS2 Winter 2005 - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

CS2 Winter 2005

Description:

Algorithm Strategies - divide-and-conquer, greedy algorithms, dynamic-programming, etc. Formal Reasoning - correctness of an algorithm or program. ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 7
Provided by: alb78
Category:
Tags: algorithms | cs2 | winter

less

Transcript and Presenter's Notes

Title: CS2 Winter 2005


1
CS2 Winter 2005
  • Elementary Algorithms
  • and Data Structures

2
  • Course objectives, (from CS2 web site)
  • Algorithhm Complexity, limits of computation.
  • Software Design, modularization and abstraction.
  • Data Structures - Gain familiarity with basic
    data structures
  • Object Oriented Programming -
  • Algorithm Strategies - divide-and-conquer, greedy
    algorithms, dynamic-programming, etc
  • Formal Reasoning - correctness of an algorithm or
    program.
  • Numerics tform continuous math concepts into
    discrete programs.
  • Today bullet 3 More on Data structures,
    recursion, etc.

3
Taxonomy of Elementary Data structures
  • Array
  • A set of items which are randomly accessible by
    numeric index.
  • Quick insertion, fast access if indices are known
  • Disadvantages Slow search, slow deletion, costly
    to change size
  • Stack
  • A collection of items where only the most
    recently added item may be removed.
  • The latest added item is at the top.
  • Basic operations are push and pop.
  • Often top and isEmpty are available, too.
  • Also known as "last-in, first-out" or LIFO
    because it provides last-in, first out access
  • Disadvantages Slow access to other items
  • Queue
  • Provides first-in, first out access
  • Disadvantages Slow access to other items
  • List
  • A collection of items accessible one after
    another beginning at the head and ending at the
    tail.

4
  • Binary tree, other trees
  • Quick search, insertion, deletion, (if tree
    remains balanced)
  • Disadvantages Deletion algorithm is complex
  • Graphs
  • Models of real-world connections
  • Disadvantages Some algorithms are slow and
    complex

5
  • Linked list
  • Quick insertion, quick deletion
  • Disadvantages slow search
  • Hash Table
  • Very fast access if key is known. Fast insertion
  • Disadvantages Slow deletion, access slow if key
    is not known.
  • Heap
  • Fast insertion, deletion, access to largest item
  • Disadvantages slow access to other items

6
Arrays
  • A0..99 data array, indexed by integers
  • AI,J 2D data array, indexed by 2 integers,
    etc.
Write a Comment
User Comments (0)
About PowerShow.com