Compsci 101, Fall 2014, Classwork Dec 4

Fill out form here

Problem 1

Consider the passes shown for a sort. Which sort is it? 4 10 5 3 8 2 4 10 5 3 8 2 4 5 10 3 8 2 3 4 5 10 8 2 3 4 5 8 10 2 2 3 4 5 8 10

Problem 2

Consider the passes shown for a sort. Which sort is it? 4 10 5 3 8 2 4 2 5 3 8 10 4 2 5 3 8 10 4 2 3 5 8 10 3 2 4 5 8 10 2 3 4 5 8 10

Problem 3

Compare the sorts SelectionSort, InsertionSort and BubbleSort on three different types of data. Which one is faster? How much faster?

  1. random data
  2. Data in reverse sorted order
  3. Data in almost sorted order