data structure
array
The correct reference to the array:
int a[10],*p=a;
*(p+2)
In C language, the string default '\0' occupies one byte, char, short, int occupy 1, 2, 3 respectively Byte
Java's char is unicode encoded, and can contain Chinese characters, except for some special Chinese characters. So char two bytes
1. Correct initialization of
A. int a[10]=(0,0,0,0)
B. int a[10]={}
C. int a[]={}
D. int a[10]={10*a}
a: parentheses changed to braces
b: yes, each element is 0
c: array length is 1, element is 0
d: array definition cannot be recursive
2. The container for easy insertion and deletion is
A.list
B.vector
C.map
D.set
a: The bottom layer of list is a doubly linked list
b: The bottom layer structure of vector is an array, which supports fast access
c: The bottom layer data structure of map is a red-black tree, Except for the hashmap disorder, other structures are ordered and not repeated
d: The underlying structure of set is a red-black tree. Except for hashset, other structures are ordered and not repeated
3. The following code can output good
char a[]="ggood";
char b[]="goodd";
char *c;
Ac=a+1;
Bc=b;c[5]='/0';
C.*c="good";
D. Compilation error
A, if B is c[4] can also
4. If the array S[1...n] is used as the storage space of two stacks S1 and S2, for any stack, only when [1...n] is full can the stack operation not be performed, then the last of the two stacks The optimal allocation scheme is
A. The bottom position of S1 is 0, and the occupied position of S2 is n+1.
B. The bottom position of S1 is 0, and the bottom position of S2 is n/2.
C. The bottom position of S1 is 1. The bottom position of S2 is n
D. The bottom position of S1 is 1, and the bottom position of S2 is 1
5. Declare a pointer to an array with 10 elements, each element is a function pointer, the return value of this function is int, the parameter is int, the correct one is *
A.(int *p[10])(int*)
B.int [10]*p(int*)
C.int(*(*p)[10])(int*)
D.int((int*)[10])*p
6. In an array with 8 int data, the data of the array is randomly given to find the largest and the second largest element must be compared several times
For the selection problem, the lower bound of finding the largest problem is n-1
to find the second The lower bound for large problems is n+logn-2
7. The correct answer is
A. The storage of the sequential storage structure must be continuous, and the storage structure of the chain storage is not necessarily continuous.
B. Sequential storage is only for linear structures, and chained storage is only for nonlinear structures.
C. The sequential storage structure can store ordered lists, but the linked storage structure cannot store ordered lists.
D. Chained storage structure saves storage space than sequential storage structure.
8. Array definition int a[4][5]
, reference *(a+1)+2
means the address of the element in the first row and second column of
the Aa[1][0] +2 Ba array Ca[0][1] +2 the value of the element in the first row and second column of the Da array
9. Let the array A[i, j], the length of each element of the array is 3 bytes, i is from 1 to 8, j is from 1 to 10, the array is stored from the first address BA of the memory, when the column is used as the main storage , the first storage address of element A[5][8] is
A.BA+180
B.BA+225
C.BA+222
D.BA+141
A
10. Let the array A=array[1…100,1…100] be stored in row-major order, each element occupies 2 storage units, the base address is 10, and LOC[5][5] should be
A.1020
B .1010
C.818
D.808
C
the stack
1. The wrong statement about the stack is
A. When the stack is empty, the stack must not be popped, otherwise it will overflow. B.
The stack must be a linear structure stored in sequence
. C. An empty stack is a stack with all elements being 0.
D. A stack input is ABCD, and the output can be obtained: CABD
2. About the stack and heap, the mistake is
A. The application method is different. The heap is automatically allocated by the system, and the stack is applied by yourself.
B. The size of the stack is fixed, and the size of the heap is limited by the effective virtual memory of the system.
C. The stack The system decides when to release the space, and the heap needs to decide when to release it
. D. The use of the heap is prone to fragmentation, but it is the most convenient to use
##Machine Learning
1. Linear regression is correct
A. The basic assumption includes a random interference item of 0 and a standard normal distribution with a variance of 1
B. The basic assumption includes a random interference item of 0 and a normal distribution with the same variance
C. In When the basic assumption is violated, the ordinary least squares estimator is no longer the best linear unbiased estimator
D. When the basic assumption is violated, the model can no longer be estimated
E. DW can be used to test whether there is serial correlation in the residual
F. Multicollinearity will reduce the variance of the parameter estimates of