Programming  >  CODING SOLUTION  >  CP 164 Data Structures _ test_Sorts_array.py. [Tests various array-based sorting functions.] (All)

CP 164 Data Structures _ test_Sorts_array.py. [Tests various array-based sorting functions.]

Document Content and Description Below

CP 164 Data Structures _ test_Sorts_array.py. [Tests various array-based sorting functions.] [Tests various array-based sorting functions.] ----------------------------------------------------------- ... ------------- Author: Jashanpreet Pannu ID: 190898790 Email: [email protected] __updated__ = "2020-12-01" ------------------------------------------------------------------------ """ # Imports import random from Number import Number from Sorts_array import Sorts # Constants SIZE = 100 # Size of array to sort. XRANGE = 1000 # Range of values in random arrays to sort. TESTS = 100 # Number of random arrays to generate. SORTS = ( ('Bubble Sort', Sorts.bubble_sort), ('Insertion Sort', Sorts.insertion_sort), ('Merge Sort', Sorts.merge_sort), ('Quick Sort', Sorts.quick_sort), ('Selection Sort', Sorts.selection_sort), ('Bin. Ins. Sort', Sorts.binary_insert_sort), ('BST Sort', Sorts.bst_sort), ('Cocktail Sort', Sorts.cocktail_sort), ('Comb Sort', Sorts.comb_sort), ('Heap Sort', Sorts.heap_sort), ('Shell Sort', Sorts.shell_sort) ) def create_sorted(): """ ------------------------------------------------------- Creates a sorted list of SIZE Number objects with values from 0 up to SIZE-1. Use: values = create_sorted() ------------------------------------------------------- Returns: values - a sorted list of SIZE Number objects (list of Number) ------------------------------------------------------- """ values = [] i = 0 while i < SIZE: values.append(Number(i)) i += 1 return values def create_reversed(): """ ------------------------------------------------------- Create a reversed list of SIZE Number objects with values from SIZE-1 down to 0. Use: values = create_reversed() ------------------------------------------------------- Returns: [Show More]

Last updated: 2 years ago

Preview 1 out of 3 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of CP 164 Data Structures _ test_Sorts_array.py. [Tests various array-based sorting functions.] document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$9.50

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

122
0

Document information


Connected school, study & course


About the document


Uploaded On

Apr 11, 2023

Number of pages

3

Written in

All

Seller


Profile illustration for PAPERS UNLIMITED™
PAPERS UNLIMITED™

Member since 4 years

509 Documents Sold

Reviews Received
55
20
8
2
8
Additional information

This document has been written for:

Uploaded

Apr 11, 2023

Downloads

 0

Views

 122

Document Keyword Tags

More From PAPERS UNLIMITED™

View all PAPERS UNLIMITED™'s documents »

Recommended For You

Get more on CODING SOLUTION »

$9.50
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·