Complexity Analysis Station [5]
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Dareen Hussein
Used 2+ times
FREE Resource
Enhance your content in a minute
5 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is asymptotic complexity in the following void function?
2.
FILL IN THE BLANK QUESTION
1 min • 1 pt
What is asymptotic complexity in the following void function?
3.
FILL IN THE BLANK QUESTION
3 mins • 1 pt
Ryan is implementing a merge sort algorithm that he heard about in computers class. However, he wasn't paying attention, and ended up implementing the merge sort in a very unusual way.
The standard merge sort takes a list, and recursively splits it in half, until there is only one element left. It then uses the idea that two sorted lists can be easily merged in O(n)time using "two pointer technique" (this step is usually called merge).
Ryan doesn't know about two pointer technique, however, so he decided to replace merge with a bubble sort! The bubble sort runs in O(n^2) time.
What is the runtime of this merge sort implementation?
4.
OPEN ENDED QUESTION
3 mins • Ungraded
Write a function named "rotate_right" that takes as its argument an array of floating point values and an integer that tells the number of cells in the array.
The function should shift the contents of each cell one place to right, except for the last cell which should be moved into the cell with subscript 0. Thus for example if the function looks like the first table above should end like the second one
Evaluate responses using AI:
OFF
5.
OPEN ENDED QUESTION
5 mins • Ungraded
Suppose a sequence A of n numbers should already be in ascending order. Thus for the
sequence (6,2,9,5,8,7) there are 6 pairs that are out of sequence:
(6,2) , (6,5) , (9,5) , (9,8) , (9,7) , (8,7)
• Implement an algorithm to return the number of these out-of-order pairs.
Hint: An out-of-order pair (Ai,Aj) is such that: ( i < j ) AND (Ai > Aj).
• Determine T(n) = number of array element comparisons.
• What is the Big-O of this algorithm?
Evaluate responses using AI:
OFF
Similar Resources on Wayground
10 questions
paquetes contables lección 1
Quiz
•
11th Grade - Professi...
10 questions
Node.js
Quiz
•
University
10 questions
6ta generación de computadoras
Quiz
•
University
10 questions
PHP Introduction - Assignment 1
Quiz
•
University
10 questions
margaret hamilton
Quiz
•
University
9 questions
BASIC HTML
Quiz
•
University
10 questions
Software Testing
Quiz
•
University
10 questions
C++ Array Quiz
Quiz
•
University
Popular Resources on Wayground
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
15 questions
Solving Equations with Variables on Both Sides Review
Quiz
•
8th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
7 questions
Different Types of Energy
Interactive video
•
4th Grade - University
7 questions
Transition Words and Phrases
Interactive video
•
4th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Biomolecules (Updated)
Interactive video
•
11th Grade - University
34 questions
Unit 5 Review - The Middle Ages in Europe-B
Quiz
•
9th Grade - University
26 questions
Day2 classwork: Permutation and combination
Quiz
•
2nd Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
