Week 7

Part 1 Profiling a program
  1. Creat a working directory week7 and download the source from week7 tutorial folder.
  2. install snakeviz and python profiling

    • Shift+Right-Click to start command prompt in the directory created
    • type "pip install snakeviz"
    • type "python -m cProfile filename.py"
    • type "python -m cProfile -o profile filename.py"
    • type "snakeviz profile"

Part 2 Tutorial exercises.
  1. Here are eight integers : 1, 7, 4, 8, 2, 6, 0. Use diagrams to show the steps of sorting the integers into descending order using selection,insertion,bubble,quick, and merge sort.
  2. In previous implementation of our Simple Billing Application, sorting of Client List was done using Python sorted() method i.e. "sorted(clientDL, key = lambda c: c.name)" which requires public attribute for sorting. Write your own sorting function so that only accessor methods of Client are needed.
  3. ALL group project