Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

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

Rating
-
Sold
-
Pages
3
Grade
A+
Uploaded on
11-04-2023
Written in
2022/2023

CP 164 Data Structures _ test_Sorts_. [Tests various array-based sorting functions.] [Tests various array-based sorting functions.] ----------------------------------------------------------- ------------- Author: Jashanpreet Pannu ID: Email: __updated__ = "" ------------------------------------------------------------------------ """ # 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', Se_sort), ('Insertion Sort', Stion_sort), ('Merge Sort', S_sort), ('Quick Sort', S_sort), ('Selection Sort', Stion_sort), ('Bin. Ins. Sort', Sy_insert_sort), ('BST Sort', S_sort), ('Cocktail Sort', Sail_sort), ('Comb Sort', S_sort), ('Heap Sort', S_sort), ('Shell Sort', S_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: d(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 Read less
Institution
CP 164 Data Structures _ Test_Sorts_array.py.
Course
CP 164 Data Structures _ test_Sorts_array.py.








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CP 164 Data Structures _ test_Sorts_array.py.
Course
CP 164 Data Structures _ test_Sorts_array.py.

Document information

Uploaded on
April 11, 2023
Number of pages
3
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$10.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
AllAcademic Other
View profile
Follow You need to be logged in order to follow users or courses
Sold
67
Member since
6 year
Number of followers
39
Documents
548
Last sold
1 month ago
All the academic resources you need.

All the academic resources you need.

3.7

7 reviews

5
3
4
1
3
2
2
0
1
1

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions