Postgraduate entrance exam 408 includes data structure, computer network, computer composition principle and operating system four subjects, each of which is the content that programmers should focus on understanding and mastering.

Although you do not necessarily take an examination of one’s deceased father grind, but follow to do the topic deepen understanding total right 👀

You can follow me or my column at 🏏

The exercises come from @Wangdao Weibo

Analysis is my own writing, if there are questions or mistakes please comment to inform, hope to point a big praise 💗

The data structure

The depth of Huffman tree constructed with the weights of leaf nodes corresponding to 6,3,8,12,5 and 7 is ___ (Beihang University, 2013)

A. 6
B. 5
C. 4
D. 3
Copy the code

Answer and analysis

Answer: C

🔊 Manually simulate Huffman tree:

As shown in the figure, the depth is 4.

The constructed Huffman tree is not unique, but the weighted path length must be the same and optimal. In the figure, the weighted path length is:


W P L = ( 3 + 5 + 6 + 7 ) 4 + ( 8 + 12 ) 3 = 144 WPL = (3+5+6+7)*4+(8+12)*3 = 144

Computer network

In computer networks ____ isolates both conflicts and broadcasts. (Jilin University)

A, switch B, repeater C, router D, all aboveCopy the code

Answer and analysis

Answer: C

🔊 specifically explains conflict domains and broadcast domains at 0x03:

Repeater/hub Bridge/switch The router
Working layer: The physical layer Physical layer + data link layer Physical layer + data link layer + network layer
Conflict domain/broadcast domain: One collision domain, one broadcast domain Isolate the conflict domain, a broadcast domain Isolate conflict domains, isolate broadcast domains

Computer composition principle

For 8-bit binary numbers, the following statement is correct ___ (North China University of Water Resources and Electric Power 2005)

A. - the complement of 127 is 10000000 B. The inverse of -127 is equal to zero shift C. The shift of +1 is equal to the inverse of -127 and the complement of d. 0 is equal to the inverse of -1Copy the code

Answer and analysis

Answer: B

🔊 The source code and the complement of the positive number are the same, and the value bit of the source code of the negative number is inverted to obtain the inverse code. The inverse code plus 1 is the complement, and the symbol bit of the complement is inverted to shift code, then:

B) the inverse code of -127 is the same as that of 0.

Shiftcoding preserves the size order of true data and can be directly compared in size. It is generally used for the logarithm of floating point operations. It’s actually the result of a mapping of truth offset on the number line.

The operating system

The strategy of orderly allocation of resources is to break the ___ condition for deadlock. (University of Electronic Science and Technology of China 2016)

A. mutual exclusion B. request and hold C. Non-deprivation D. circular waitCopy the code

Answer and analysis

Answer: D

🔊 Orderly resource allocation The resources are uniformly numbered according to a rule (for example, 1 for printers, 2 for tape drives, and 3 for disks).

  1. All resources that it must use and belong to the same category must be applied for at one time
  2. When applying for different types of resources, you must apply for them by device number

A) dynamic allocation b) sequential allocation C) dynamic allocation D) sequential allocation