This is the 16th day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021

๐Ÿป Data structure

The expression (a-b-c)*d suffix expression is ___. (Xiamen University, 2011)

A. b-c-d* B.a - BC -d* C.a - CD -* D.a -c-*dCopy the code

parsing

Answer: A,

๐Ÿฒ feel this kind of problem see option directly instead a bit faster.

Process: Iterate over each number and symbol of the expression from left to right. If it encounters A number, it will be pushed onto the stack. If it encounters A symbol, the two numbers at the top of the stack will be pushed off the stack and the operation results will be pushed onto the stack until the final result is obtained, A pair.

Another method: using expression binary tree, the operator is the child root, the operand is the leaf node, using the post-order traversal can get the post-order expression sequence.

๐Ÿผ Computer network

The IM system generally adopts ___ mode and P2P mode. (Wuhan University, 2012)

A. Transshipment B. C immediately. D. indirectCopy the code

parsing

Answer: A,

๐Ÿฒ instant messaging systems generally use client/client mode, that is, the point-to-point mode (P2P mode), the other is client/server mode, that is, the sending and receiving of messages must be through the server to transfer (that is, the transfer communication mode).

๐Ÿจ Operating system

Operating system scheduling algorithm is one of the core algorithms, the following statement about scheduling algorithm is correct. (Nanjing University of Aeronautics and Astronautics, 2014)

A. The first-come-first-served scheduling algorithm is beneficial to both long and short jobs. B. Time slice rotation scheduling algorithm is only beneficial to long operations. C. Real-time scheduling algorithm also considers the problem of job length. D. The high response ratio priority scheduling algorithm is beneficial to both short jobs and long jobs.Copy the code

parsing

Answer: D

๐Ÿฒ to sum up!

  1. Short job first algorithm is beneficial to short job but disadvantageous to long job. May cause long operations appear “hunger” phenomenon. Short job – first algorithm makes the average turnaround time shortest.

  2. **FCFS algorithm (first come, first served) ** Is unfair to short processes. When long processes are at the front of the ready queue, they will inevitably increase the waiting time of short processes behind them, thus increasing the average turnaround time of the system. FCFS algorithm is good for IO jobs but bad for CPU busy jobs.

  3. Interactive system, such as our common time-sharing system, adopts time slice rotation algorithm. When the time slice is large enough, the algorithm degenerates into FCFS algorithm. The time slice is too small, and the system switching process costs too much. The factors affecting the time slice length are the response time of the system, the number of processes in the ready queue, and the processing capacity of the system. With regard to this algorithm, we believe that it is beneficial to both long and short assignments. Short jobs can be completed in a few rotations, and long jobs can’t go unexecuted for a long time.

  4. The highest response ratio priority algorithm is a comprehensive balance between FCFS algorithm and SJF (short Job first) algorithm. The calculation formula of response ratio is as follows:


    Response than = Waiting time + Allow time The elapsed time Response ratio = \frac{wait time + allowed time}{run time}

    According to the formula, this algorithm is beneficial to short jobs while taking into account long jobs. As long as a long process waits for a long enough time, it will always become the one with the highest response ratio and be scheduled to execute.

  5. The real-time scheduling algorithm sets the priority of the job (process) according to the urgency of the job (process). The scheduling algorithm selects the process with the highest priority in the current ready process to schedule execution, regardless of the length of the job.

๐Ÿปโ„๏ธ Computer composition principle

The time it takes a CPU to access a memory or I/O port once is called ___. (University of Science and Technology of China, 2014)

A. Bus cycle B. instruction cycle C. clock cycle D. Basic cycleCopy the code

parsing

Answer: A,

๐Ÿฒ common sense! The bus cycle consists of an address cycle and one or more data cycles.

In the process of CPU executing instructions, all operations that need to be performed to access memory or ACCESS I/O ports are uniformly handed over to the external bus to complete, and the time required for a access (access to a byte) is called a bus cycle.

The exercises come from @Wangdao Weibo

The analysis is written by myself, if there are any questions or mistakes, please comment.

I am Mancuoj, welcome to pay attention to me and my computer entrance examination column (โ‰งโˆ‡ Blue)