f*****s 发帖数: 141 | 1 Two ways of holding 2-dimensional array:
(1) vector of vector
(2) Just use one vector
Which is more disadvantageous in terms of memory allocation? such as
fregmentation issue? |
J******d 发帖数: 506 | 2 If memory is very fragmented, (1) should be better. |
f*****s 发帖数: 141 | 3 I also think so, but looks like the interviewer prefer (2)...He is a >10-
year quant in a top IB. |
J******d 发帖数: 506 | 4 Maybe he didn't express his question clearly or you misunderstood?
If he actually meant "which way is less likely to get the memory
fragmented?" (or "safer to use if want to avoid fragmentation"), then of
course, (2).
Basically, I am asking if "fragmentation" is the result of the reason.
>10-
【在 f*****s 的大作中提到】 : I also think so, but looks like the interviewer prefer (2)...He is a >10- : year quant in a top IB.
|
r*******t 发帖数: 8550 | 5 A) this question is a pure IT question
B) 2) will create less fragmentations if used.
【在 f*****s 的大作中提到】 : I also think so, but looks like the interviewer prefer (2)...He is a >10- : year quant in a top IB.
|
z****g 发帖数: 1978 | 6 most LAPACK and CBLUS library is implemented assuming that vector is
allocated in the
second way.
【在 f*****s 的大作中提到】 : I also think so, but looks like the interviewer prefer (2)...He is a >10- : year quant in a top IB.
|