c - most efficient way to get through array? -


i have been thinking , wondering fastest algorithm through every element of (large - lets more 10,000 sized) unsorted int array. first thought go through linear motion , check every element @ time - mind wandered recursion , wondered if cutting array parallels each time , check elements fine.

the goal i'm trying figure out if number (in kind of array) multiple of seemingly "randomly" generated int. after progress try , find if subset of large array equate multiple of number well. (but part day!)

what of thoughts? questions? comments? concerns?

you seem under false impression bottleneck running through array sequentially ist cpu: isn't, memory bus. modern platforms in predicting sequential access , doing streamline access, can't more that. parallelizing not help, since have 1 memory bus, bottleneck, in contrary risking false sharing worse.

if reason doing lot of computation on each element of array, picture changes. then, can start try parallel stuff.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -