Question
1. Watch the following video: Sorting Algorithms: Speed Is Found In The Minds of People - Andrei Alexandrescu - CppCon 2019 https://www.youtube.com/watch?v=FJJTYQYB1JQ 1. What sorting
1. Watch the following video: Sorting Algorithms: Speed Is Found In The Minds of People - Andrei Alexandrescu - CppCon 2019 https://www.youtube.com/watch?v=FJJTYQYB1JQ 1. What sorting algorithm was the speaker trying to improve?
2. At what partition size does VS perform a simpler sort algorithm instead of continuing to partition?
3. At what partition size does GNU perform a simpler sort algorithm instead of continuing to partition?
4. Regular insertion sort does a linear search backwards from end of array for correct spot to insert. According to the speaker, why does switching to a binary search not improve performance?
5. Describe what is meant by branch prediction? (this may require further research)
6. What is meant by the term informational entropy? (this may require further research)
7. If size == 15, what is size & 1? if size == 16, what is size & 1? Explain how right = first + 1 + (size & 1) avoids a conditional check. Hint: o The & is the bitwise AND operator in C/C++. It takes the bit representation of the two operands and perform an AND operation on each of the corresponding bits to form a result o To do this question first convert 15, 16 and 1 to base 2 (use 5 digit representation for all of them). Then perform an AND operation of the correseponding bits of the operands... this will get you a 5 digit binary value. Convert the value back to base 10 .
8. Speaker suggests the following algorithm: o make_heap() o unguarded_insertion_sort() He suggests that by doing make_heap() first then you can do something called unguarded_insertion_sort(). Explain what is unguarded_insertion_sort() and why it is faster than regular insertion sort. How does performing make_heap() allow you to do this?
9. The speaker talks about incorporate your conditionals into your arithmetic. What does this mean? Provide an example of this from the video and explain how the conditional is avoided.
10. The speaker talks about a bug in gnu's implementation. Describe the circumstances of this bug.
11. The speaker shows several graphs about what happens as threshold increases using his new algorithm. The metric of comparison is increased, the metric of moves are increased but time drops... What metric does the author think is missing? Describe the missing metric he speaks about in the video. What is the metric measuring?
12. What does the speaker mean by fast code is left leaning?
13. What does the speaker mean by not mixing hot and cold code?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started