Cattle brush off questions one week summary (arrays and linked lists)

The basis of the wrong questions

1 in the general impression of write cycles, small cycles on the outer layer, the inner layer on a cycle, so the implementation will be faster. But this question in the array A large array of B than many might cross a lot of pages, resulting in a lower rate of missing pages or cache hit rate, so in this case pb faster.

 

 

2

This problem mainly related memory understanding of grammar, syntax basic computer, the array is always zero, for a one-dimensional array with N elements, subscripts 0 to N-1 .. Therefore, in the present problem, the index of the first element is represented by myArray {0} {0}, {2} problem in {2} is understood as the third element of the third row, the lookup data will find third line only two elements, beyond the location of the array access, an overflow occurs.

 

This question focuses on whether the election D. This chain scission. Two chains to be inserted first node arranged, again adjust the original node. If the first arrangement of the original node chain, the chain scission is almost always generated. So A, B is not available, do not look. Item C, adjusting the original node, the first adjustment is the p-> next = s, and finally with p-> next-> prior, in this case p-> next is already a s.

YJN
Released four original articles · won praise 0 · Views 16

Guess you like

Origin blog.csdn.net/qq_41812260/article/details/104384404