ITEC 3264
Assignment 2
Write a Python class, Flower, that has three instance variables of str,
int, and float, that respectively represent the name of flower, its number
of petals, and its price. Your class must include a constr
ITEC 3264
Assignment 4
Describe a nonrecursive algorithm for enumerating all combinations of
the numbers cfw_1, 2, , n using an explicit stack. Each combination
should appear only once. (100 points). Here is an example. If n is 3, your
ITEC 3264
Assignment 1
Part 1.
Enroll in our course at D2L. Post a message in the Assignment
discussion thread. In this message, please briefly introduce yourself
including your name, your background of IT, and so on. (50 points)
ITEC 3264
Assignment 3
Given a sequence with two or more numbers, you need to write a
recursive Python function that finds the 2nd biggest value in this
sequence without using any loops. Please demo how to use this
r
ITEC 3264
Assignment 4
Describe a nonrecursive algorithm for enumerating all permutations of
the numbers cfw_1, 2, , n using an explicit stack (100 points).
a. A pdf or txt file, which describes your algorithm. Pseudo-code is
preferred. All detai
ITEC 3264 Data Structures and Algorithms
Chapter 3 Algorithm Analysis
Complexity Comparisons
Lets take a look at some hypothetical numbers to help solidify the comparisons. The following table
shows execution time as the input size increases:
n
O(log(n)
O
def insertion_sort(A):
for k in range(1, len(A):
cur = A[k]
j = k
while j>0 and A[j-1]>cur:
A[j] = A[j-1]
j -= 1
A[j] = cur
def main():
reply = (input('Enter a series of numbers separated with spaces: ')
data = reply.split()
insertion_sort(data)
val = len
class flower:
def _init_(self, str, int, float):
"
str the name of the flower
int the number of petals
float the price
"
self._str = str
self._int = int
self._float = float
def getstr(self):
print (self._str)
def getint(self):
print (self._int)
def getflo
The first part of my program defines the comb function which finds unique
combinations of the input.
Next is the main function which requests input, and makes that input readable as
numbers. Finally, it puts that data through the comb function.
Lastly, my
def comb(stack, rest, n):
n = len(rest)
if n = 0:
print (stack)
else:
for i in range(len(rest):
comb(stack + rest[i], rest[i+1:], n-1)
def main():
reply = (input('Enter a series of numbers separated with spaces: ')
data = reply.split()
comb(", data, len(d
The first part of my program defines the comb function which finds unique combinations of the
input.
Next is the main function which requests input, and makes that input readable as numbers.
Finally, it puts that data through the comb function.
Lastly, my
I started by defining the insertion_sort function which would re-order my array in ascending
order.
Next, I defined the main function and asked for input from the user to create the list of numbers.
Then I split the provided list into an array.
Then I ran
I started by defining the insertion_sort function which would re-order my array in
ascending order.
Next, I defined the main function and asked for input from the user to create the list
of numbers. Then I split the provided list into an array.
Then I ran
Rachel Nowak
First, I defined my class flower, with notes indicating what each of the variables represent.
Next was writing the functions which would display output for each of the outputs.
Next, I defined the main function, and made some instances of my
Rachel Nowak
First, I defined my class flower, with notes indicating what each of the variables
represent.
Next was writing the functions which would display output for each of the outputs.
Next, I defined the main function, and made some instances of my
O(n)
n = size of data being passed into the function
Data Structures and Algorithms Chapter 3 Algorithm Analysis
37 terms
Vocabulary for Data Structures and Algorithms Chapter 3 Algorithm Analysis. Find, create, and access Computer Science, Algorithms, flashcards with Course Hero.