4. Describe the best case, average case, and worst case in terms of Big O Notati
ID: 3729730 • Letter: 4
Question
4. Describe the best case, average case, and worst case in terms of Big O Notation. When implementing algorithms or data structures which two “Big O cases” are most important to consider and why?
5. Bubble Sort and Selection Sort explain the similarities and difference between the two algorithms. What is the Worst Case Big (O) and why?
6. Compare and Contrast C++ to Python programming languages? How do the characteristics of the languages impact the amount of memory each language occupies. How do memory considerations impact each languages real-world implementations?
7. What are the key factors that impact the effectiveness of a sorting algorithm?
Explanation / Answer
4.Best case :The Maximum time taken For the best input of a given algorithm .
Worst Case:The Maximum time taken For the worst input of a given algorithm .It means at any time , u give any input it won't exceed the given limit.
Average Case : It simulates the Best and Worst case averages ....
5.Bubble sort : It sorts adjacent elements in each iteration . And continues until the list will be completely sorted.
Worst case time complexity is O(n^2)
Insertion Sort:We take each From second element to last and insert that current input in already sorted i-1 subarray.
Worst case time complexity is O(n^2)
6. C++ is termed as high level programming language whereas python termed as Scripting language.
c/c++ are System embedded language so they are used for developing system utility programs whereas python is highly useful in advanced technlogies like machine learning , data science etc... Python have huge set of libraries compared to c++ and also type less language . It is less error proned.. The memory usage is depends on the requirements of application which u want to develop . Normally python is faster.....
7. Factors are algorithmic complexity, startup costs, additional space requirements, use of recursion (function calls are expensive and eat stack space), worst-case behavior, assumptions about input data, caching, and behavior on already-sorted or nearly-sorted data.
// I tried to solve all of ur questions . Thanks in advance....
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.