"Why is processing a sorted array faster than processing an unsorted array?"
A stack overflow user asks why processing a sorted or unsorted version of an array results in a drastic performance difference. We discuss CPU branch prediction and why it can be important for optimization.
Using std::sort from STL
Original post:
https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-processing-an-unsorted-array
#c++ #optimization #programming #coding #stackoverflow
0 Comments