Home > Back-end >  The data structure
The data structure

Time:06-05

Can detailed analysis of A, B, C, D? Thank you very much!

CodePudding user response:

Sequential method to find 1 2, 3, 6, respectively, with the number of times is 1
2, 3, 6 timesDichotomy found 1 2, 3, 6, respectively, with the number of times is 1, 3, 4, 2
Add up to know
The key is to determine the dichotomy found the process of the number of 1, 2,
Range of 1 ~ 11 for the first time, is compared to six, namely one find 6
The second range 1 ~ 5, is compared with 3, 2 times to find 3
1 ~ 2 for the third time, , which is 3 times to find 1, 4 times find 2
Why is 1 and 2 after 1, 2 and generally mid=+ large (small)/2 natural truncation forensics, won't call a ceil or floor function such as
(1 + 2)/2 again, the result is 1,

CodePudding user response:

Fun
reference 1 floor response:
order method to find 1 2, 3, 6, respectively, with the number of times is 1
2, 3, 6 timesDichotomy found 1 2, 3, 6, respectively, with the number of times is 1, 3, 4, 2
Add up to know
The key is to determine the dichotomy found the process of the number of 1, 2,
Range of 1 ~ 11 for the first time, is compared to six, namely one find 6
The second range 1 ~ 5, is compared with 3, 2 times to find 3
1 ~ 2 for the third time, , which is 3 times to find 1, 4 times find 2
Why is 1 and 2 after 1, 2 and generally mid=+ large (small)/2 natural truncation forensics, won't call a ceil or floor function such as
(1 + 2)/2 again, the result is 1.

Special thank you for your reply!   but I have a question that is in the title in the array of component 1 ~ 11, if the array a, from small to large, stored in sequence is a [1]=1, then, a [2]=2... This store? If such a [0] not so there is no storage elements, so why not start from 0 subscript sequential access? Can you help me to solve my confusion of the heart?   looking forward to your reply!

CodePudding user response:

Only in accordance with the extent of the subscript 1 ~ 11 this put data to explain through

If it is 0 to 10, how explain impassability,

Personal think the description of the subject has a problem, the contents of the original component index is the concept of group, but in that case the total lookup is complex, the result is wrong

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related