Giter Site home page Giter Site logo

csce4110-a1p3's Introduction

Assignment 1 (Due October 25 2018)

You are encouraged to work in groups (but not more than 2 persons in a group). Show all your computation to get full credit. Please put comments in your code. I will deduct points for uncommented code. You can write the programs in any language you choose so long as we can run it. This assignment is worth 13% of your total grade.

Part 1. Proofs (5 * 3 = 15 points)

Prove the following statements.

  1. is an irrational number
  2. If a - b is divisible by c, then - is divisible by c
  3. If - 1 is a prime number then n is a prime number

Part 2. Complexity Computation (5 * 5 = 25 points)

Compute the big Oh complexity for the following recursion relations.

Part 3. Multimethod Sorting (35 points)

Create sets of integers with the following characteristics with array sizes of 100,000; 500,000; and 1,000,000 (10).

  1. Set where no integer is repeated
  2. Set where the range is 1% of the array size and the integers repeat

Compare the performances of the following sorting algorithms. You can either write the algorithms on your own or modify algorithms obtained from elsewhere (15).

Create a table with the rows being the different algorithms and the columns being the inputs. Run each input 10 times and report the mean, and standard deviation for each run. You can also represent the results as a table. Write a short summary (about 1 paragraph) on your observations (10).

  1. Quicksort
  2. Quicksort until size of set is <= 1,000; 500; 100; 10 and then using insertion sort
  3. Countingsort

Part 4. Red-Black Trees (35 points)

Consider these two relaxations to the constraints of red-black trees together.

  1. The root can be red or black
  2. The red nodes can have at most one red child

List the changes to the addition and deletion rules you need to maintain these conditions (10).

Modify existing code (or write your own) of a red-black tree to include these relaxations (9).

Explain either analytically or through empirical results whether the black height will be maintained in all paths (5).

Create a set of 100,000 integers. Insert these integers to (i) the original red-black tree; and (ii) the modified red-black tree. Repeat this step about 6 times with different sets of integers, and report the mean, maximum, and minimum values of the following (4 * 4 = 16).

  1. Tree height
  2. Black height
  3. Time to insert
  4. Time to search

csce4110-a1p3's People

Contributors

chaoticweg avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.