2019-2020-2 data structure 1st unit test error

2-1
If a queue is known as a singly linked list, the current state of the singly linked list (including 3 objects) is: 1-> 2-> 3, where x-> y indicates that the next node of x is y . At this time, if the object 4 is enqueued and the object at the head of the queue is dequeued, the state of the singly linked list is: 2-> 3-> 4

2-7
If the most common operation of a linear table is to access any element with a specified sequence number and insert and delete operations at the end, which storage method is used to save the most time?
Sequence table

2-11
The recursive formula of the time complexity of a given program: T (1) = 1, T (N) = 2T (N / 2) + N. Then the program time complexity is
O (NlogN)

2-12
Array A [1..5,1..6] Each element occupies 5 units, and it is stored in consecutive memory cells with a starting address of 1000 in line priority order, then element A [5, 5] The address is:

1000 + (6 * 5) * 4 + 5 * 5 = 1000 + 120 + 25 = 1145
but 1145 is the address of the memory unit after A [5,5] (that is, the first address of A [5,6]). Therefore, the first address of A [5,5] is 1145-5 = 1140.
If you have studied assembly, it is easy to understand.

[Example]:
Each element of the array A [0..5,0..6] occupies five bytes, and it is stored in a memory unit with a starting address of 1000 in column priority order, then the element A [5 , 5] The address is (A).
A. 1175 B. 1180 C. 1205 D. 1210

The hexadecimal letter means: binary is B, octal is O, decimal is D, and hexadecimal is H

2-13
The storage status of a singly-linked list with known header element c in memory is shown in the following table: [figure omitted]
now store f at 1014H and insert it into the singly-linked list, if f is logically located at a And e, then the "link address" of a, e, f

Yes:
1014H, 1004H, 1010H

[Note] Pay attention to a theorem: a binary tree with n nodes has k = logn layers

 

Guess you like

Origin www.cnblogs.com/hechenniu/p/12694172.html