Skip to content

Sum Finder Program - finds 2 numbers from an array of numbers that add up to a randomly generated sum, using the Brute Force method and the Hash Map method, both for sorted and unsorted randomly generated arrays.

Notifications You must be signed in to change notification settings

jordantbui/Midterm-Project-2-CS-3310

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Midterm Project 2 - CS 3310

Sum Finder: Brute Force & Hash Map Program

10/12/2020

Jordan Bui (BroncoID: 011821368)

CPP Fall 2020

CS 3310 Design and Analysis of Algorithms

Midterm Project 2 Code Implementation

Implements two different methods for finding a given sum between 2 numbers in a given array and returns the sum and the 2 numbers.

This program tests the Brute Force Method and the Hash Map method for bot sorted and unsorted random arrays.

Both are tested using a randomly generated sum and randomly generated arrays.

Sum Finder

Given an array on numbers and a desired sum, this program searches the given array for any 2 numbers that add up to the given sum and displays the 2 numbers as well as the sum.

  • Tests Brute force for sorted and unsorted random arrays.
  • Tests Hash Map method for sorted and unsorted random arrays. (Same algorithm used for sorted and unsorted arrays)
  • Displays Run Times for each method tested on both sorted and unsorted arrays for all array sizes.
  • Comb Sort is used to sort the array but not accounted in the run times.

About

Sum Finder Program - finds 2 numbers from an array of numbers that add up to a randomly generated sum, using the Brute Force method and the Hash Map method, both for sorted and unsorted randomly generated arrays.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages