Is it possible to precisely estimate on paper how much RAM will be consumed for a simple algorithm (bubble sort) in C on a trivial dataset (10 integer array)? Or will compiler implementation concerns and 'byte padding' make this impossible?
(Given a platform such as a 32bit x86 machine).
Bubble sort can work in-place, so it needs no memory except the array you sort.
A 10 integer array takes 40 bytes, plus some small platform dependent allocation overhead.
If you want a really precise estimate, you need to consider the size of the executable, memory used for process management, and more. But on x86, which normally has lots of memory, these things are really nothing to worry about.
If the array is larger, then it takes 4 bytes per integer, and the overheads, which stay the same, become negligible. There's no padding between the integers, so for large arrays, all you should care about is the 4 bytes per integer.