WGU C949 - Data Structures And Algorithms exam with 100% correct answers 2024
WGU C949 - Data Structures And Algorithms exam with 100% correct answers 2024 What is the Big O Time Complexity of Selection Sort O(n^2) What is the Big O Time Complexity of Insertion Sort O(n^2) What is the Big O Time Complexity of Bubble Sort O(n^2) What is the Big O Time Complexity of Merge Sort O(n log n) What is the Big O Time Complexity of Quick Sort O(n log n) What is the Big O Time Complexity of Heap Sort O(n log n) What is the Big O Time Complexity of Radix Sort O(nk), where k is the number of digits in the largest number in the array. __________ is a way to describe the upper bound of how an algorithm's running time or space requirements grow as the input size increases. Big-O notation If the number of steps stays the same no matter how large the input size is, the time complexity is constant and represented by O(1). Examples include accessing an element in an array or performing a simple arithmetic operation. Constant Time Complexity If an algorithm goes through a long list linearly, the time complexity is proportional to the input size and represented by O(n). Examples include traversing a linked list or array. Linear Time Complexity If an algorithm goes through a long list and then performs n operations each time, the time complexity is proportional to n squared and represented by O(n^2). Examples include nested loops where each loop has n iterations. Quadratic Time Complexity If an algorithm performs two or more different operations, the time complexity is determined by the highest order term in the expression that represents the total number of operations. The lower order terms and constants are dropped because they become insignificant as the input size increases. Combining Complexity Big-O notation is simplified by dropping the lower order terms and constants. For example, O(n^2 + 3n + 5) is simplified to O(n^2). Simplifying Notation To determine the Big-O time complexity of an algorithm from pseudocode, you need to count the number of operations performed as a function of the input size and identify the highest order term in the resulting expression. Analysis Process ___________ describes a sequence of steps to solve a computational problem or perform a calculation Algorithm _____________ data structures not only define how data is organized and stored but also the operations performed on the data structure. Algorithms for data structures List the Time Complexity from fastest to slowest O(1) Constant O(log(n)) Logarithmic O(log^c(n)) Polylogarithmic O(n) Linear If the number of steps stays the same no matter how large n is, then it’s ____________ constant time: O(1) If you go through a n long list (linearly; say a loop), then you’ll take at most n steps is O(n) linear If you go through a n long list and then n things each time (e.g.., a loop inside a loop), then you’ll take at most _______. Often you simply need to count the number of for and while loops. O(n^2) procedure SomeProcedure for i=1 and 1=n do j=1 while jn do j=j+2 O(n^2) - count the loops - 1) for 2) wh
École, étude et sujet
- Établissement
- WGU C949
- Cours
- WGU C949
Infos sur le Document
- Publié le
- 8 février 2024
- Nombre de pages
- 20
- Écrit en
- 2023/2024
- Type
- Examen
- Contenu
- Questions et réponses
Sujets
-
wgu c949 data structures and algorithms exam wit