Post #668
380
Forwarded from Syra's Techbinder
https://stackoverflow.com/questions/11227809/why-is-it-faster-to-process-a-sorted-array-than-an-unsorted-array
Tags: #programming #architecture
Stack Overflow Why is conditional processing of a sorted array faster than of an unsorted array? In this C++ code, sorting the data (before the timed region) makes the primary loop ~6x faster:
#include <algorithm>
#include <ctime>
#include <iostream>
int main()
{
// Gene... Tags: #programming #architecture
