Rebound

xiaoxiao2021-03-06  44

These are tossing, but delays this matter. Busy and leisure (as if the order is not right, this is to be busy) to make a test topic, and do one more, look at the difficulty. It feels that if undergraduate graduates, there should be no problem in the school semester. Below is an interview question, basic distribution is data structure 2 operating system 2 Database 3 Compilation Principle 1 Network 2 Programming 2 Professional English 1

1. Write a pseudo code for ascending a set of interested numbers using a method of ordering.

Bubble_sort (int R [], int count)

{

For (INT i = 1; i

For (int J = 0; j

{

IF (r [j-1]> r [j])

SWAP (R [J-1], R [J])

}

}

Simple_selection_sort (int R [], INT COUNT)

{

For (int i = 0; i

{

INT min = r [i]

INT min_pos = i

For (int J = i 1; j

{

IF (R [J] "

Min_pos = j;

}

IF (min_pos! = i)

SWAP (R [i], r [min_pos]

}

}

INSERT_SORT (int R [], int COUNT)

{

For (int i = 1; i

{

J = 0

While (R [J]

IF (j! = i)

{

INT t = r [i]

For (int m = i; m> j; m -)

R [m] = r [m-1]

R [J] = T

}

}

}

2, write out the pseudo code traversed by the second-fork tree order.

Preorder (root)

{

IF (root! = null)

{

Visit (root)

Preorder (root-> lchild)

Preorder (root-> rchild)

}

}

3. Why do you want to synchronize and muters between processes (threads)? What method is used?

Synchronization and mutual exclusion between processes (thread) are mainly to prevent "time-related errors", if there is a shared data (critical area) between processes (threads), if the use of critical regions is not controlled, it may cause errors the result of. The method of synchronization and mutual exclusion is mainly achieved by semaphore.

4, briefly describe the principle of virtual memory management.

Virtual Memory Management is a technique that allows the process to use storage space than the actual memory of the computer. When the process is run, the accessed address is a logical address, and the operating system converts the logical address through the address mapping mechanism into a physical address, physical address. Composed of segment (page number) and segment (page), then query segment (page) table, if this segment (page) is in the main memory, directly access, if the paragraph (page) is not in the main memory Within the outside, the segment (page) is read again after re-access by a certain phase-out algorithm.

5, write the following SQL statement

Table 1: BOOK

Field 1: Book_ID Book Number

Field 2: Book_name Book Name

Field 3: Book_Type Book Type Field 4: Book_Price Unit Price

Field 5: PUB_ID Press Number

Table 2: Publisher

Field 1: PUB_ID Press Number

Field 2: Pub_name Press Name

Field 3: Pub_Address Press Address

Field 4: Pub_ZIPCode Press Postal Code

a. The average price of the table Book is greater than 50 yuan.

Select Book_Type "Book Type", AGV (Book_price) "Average Price"

From book

GROUP BOOK_TYPE

Having AVG (Price)> 50

b. Ask all publishing agencies of all publishing "Computer" types

Select pub_name

From public Publisher P

WHERE EXIST

(SELECT *

From book b

WHERE P.PUB_ID = B.PUB_ID and book_type = 'Computer')

c. Assume that the table BOOK01 and the table BOOK structure are consistent, please insert all the records of all prices in the table Book into the SQL statement of the table BOOK01.

INSERT BOOK01

(Book_ID, Book_name, Book_Type, Book_Price, Pub_ID)

SELECT *

From book

Where boo_price> 100

6. Establish an index on a table, what is the impact on this table's query, deletion, insertion, and update?

The index on the table will increase the query speed on the main index field, and the main index field refers to the first index field of two or more fields. For deletion, insert, and update, performance can be reduced due to the re-indexing of data and re-indexing, depending on the way the index is. Therefore, do not establish an index of indexes on a table to avoid reducing performance.

7. What is the cause of the dead lock?

The root cause of the dead lock is that the resource contention, if users A and B are updated, request exclusive locks, A, B separately, after the page T, then, then apply to apply for each other The locking page is exclusive, which will lead to a part of the resources, while waiting for the other party to release resources. Both users can not continue to run, form a deadlock.

8, describe the structure of the email address string with a regular expression.

(. | DIGIT) @ (. | DIGIT) (/. (igit) ))

9. Briefly describe the seven-layer structure of the OSI network and the four-layer structure of TCP / IP.

The OSI Seven-layer structure is: physical layer, data link layer, network layer, transport layer, session layer, representation layer, application layer.

The four-layer structure of TCP / IP is: network to the host layer, Internet layer, transport layer, application layer.

10. Write the communication process of selecting a retransmission mode down window protocol.

send:

If the send window is not full, the buffer sends a data frame, and transmits the data frame, which includes an ACK information. It is the most recent confirm frame number other than the receiving window of this site. The send window plus 1, stop the sending confirmation, start waiting to be confirmed .

If you wait for a confirmation timeout, the timeout data frame is retransmitted.

receive:

If the data is received, the data frame is verified, and if the data frame check is wrong, the NAK frame is sent.

If the data frame is normally, check the data frame number is not in the received window, and if there is or equal to the receiving window frame number in the window, it is stored in the reception cache. Receive window plus 1. Start sending a confirmation time. If there is in the window but not equal to the current receiving window number, the data is stored in the cache, and the NAK frame is transmitted.

Receive an ACK signal within the data frame or a separate ACK frame, then the send window is adjusted according to the frame number in the ACK. And stop the respective frames of the waiting confirmation timing. If the NAK frame is received, the required data frame is retransmitted.

If the confirmation is sent, the ACK frame is constructed.

11. Write the function of finding the substrings in a string with C.

Parameter Description:

Char * S: Source string,

Char * T: Sub strings found.

return value:

If match, the output substrings are in the start position of the source string. Otherwise returns -1.

INT FINDSUBSTRING (Char * S, Char * T) {

Char * s1;

Char * t1;

INT POS = 0;

INT POS1 = 0;

INT FIND = 0;

INT less = 0;

IF (* s == '/ 0' || t == '/ 0')

Return -1;

While (! Find &&! Less && s! = null) {

IF (* s == * t) {

S1 = S;

T1 = T;

While (* S1 == * T1 && * S1! = '/ 0' && * t1! = '/ 0')

S1 , T1 ;

IF (* t1 == '/ 0')

Find = 1, POS1 = POS;

IF (* S1 == '/ 0')

Less = 1;

}

S , POS ;

}

IF (find)

Return POS1;

Else

Return -1;

}

12. Write a function that converts 10 credit into a 16-based number (represented by a string).

Function prototype: Void DectoHex (int D, char * h, int LEN)

Parameter Description:

INT D: A integer 10-based number.

Char * H: A string, stored 16 credits after the conversion.

INT LEN: String length.

Return value: no

Void Dechannel Hex (int D, char * h, int LEN) {

Int m;

Char hexstring [] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'c', 'd', 'e', ​​'f'};

Char t [128];

INT i = 0;

Int J;

Do {

m = D% 16;

D = D / 16;

T [i ] = hexstring [m];

WHILE (D> 0 &&len> 0);

IF (d> = 16 && gs == 0)

STRCPY (H, "overflow");

Else {

For (j = 0; j

H [J] = T [I-1-J];

H [J] = '/ 0';

}

}

13, translate the following paragraph

转载请注明原文地址:https://www.9cbs.com/read-79808.html

New Post(0)