Algorithm Analysis (CSC 301 2015F) : EBoards

CSC301.01 2015F, Class 08: Roles of Data Structures and Abstract Data Types


Overview

Preliminaries

Admin

Upcoming Work

Extra Credit

Academic

Peer

Questions

For part 1, what should we use to look at runtimes?

You should use some time function in C. For example, clock seems pretty cool. If you'd rather instrument your program to count key operations (e.g., comparisons, that would also be okay).

    static long comparisons = 0;

    int compare(int x, int y)
    {
      ++comparisons;
      if (x < y) 
        return -1;
      else if (x == y)
        return 0;
      else
        return 1;
   } // compare

Where can we find an algorithm for determining the kth largest value in an array?

quickselect seems like a pretty good one.

What is the master theorem?

See p. 137 of Skiena.

Abstract data types

Questions for your group:

What is an ADT?

Why do we use ADTs?

What steps do you use in designing an ADT?

Data structures

Questions for your group:

What is a data structure?

Why do we use data structures?

What steps do you use in designing or building a data structure?

What are relationships between ADTs and Data Structures?

The Dictionary ADT

_If you haven't seen dictionaries, think of them as generalized hash tables.

Questions for your group: