Google Zhejiang University (original exam)

Source: Internet
Author: User

I. single answer
$ M0 Q7} 2 M & T. z * l
1. 10 in 80 x86
Number-3 is expressed?
-A "P7 U $? $ B6 ^ 5 I
2. Assume that the symbols-, *, and $ represent
Subtraction, multiplication, and exponential operations, and 9
L6 z7 U/o j $ B $ Q # H

1) the priority order of the three operators is:-highest, * Second, $ lowest; (H3 H. F! L4 G: Maid ^! V5 C! E

2) The operator is left-aligned during operation. Calculate the value 3-2*4 $1*2 $3: # I, A7 ^ 1 x (d9g # A $ {-/3G

(A) 4096, (B)-61, (c) 64, (d)-80, (e) 512
4 u! A r "T" S5 J
3. The following pseudocode
The parameter is passed by reference. What is the result?
&~ * N' X5 B * I
Calc (Double P,
Double Q, double r) "I: w6 g/W9 W; h; I/J

{Q = q-1.0; r = R + p} 2
R, G + a' X4 Z

Main () {0 B0 S (
W. H # ^-T. [& S5 d

Double A = 2.5, B = 9.0;
.~, M: F8 {5 G'] 0 p. x9 y
Calc (B-,
A, );
) G7 V5? 0]) V, '. v
Print ();
"D! N ({: C4 p! T {H +/
} * [. V: I0 H! K) x, S

(A) 1.5 (B) 2.5 (c) 10.5 (d) 8 (e) 6.5. S4 O7} & W, u! Z! ] 2} # s

4. output result:
2 w3'/C; A9 {; F2 K
Int Foo (int x,
Int y ){
2 S 'n' + B. Z9 H5 U5 X: |. B6 ^ 9 B-o
If (x
<= 0 | Y <= 0) return 1; # P # B3 C8 C/y //: Q; {9 J "y # B

Return 3 * Foo (X-1, Y/2 );
. T * C/W. V & Z-h o
}
1 N & Q) '2' 1G. E9 o $ R5 I
Printf ("% d/N ",
Foo (3, 5); %
Z * n. _ maid K0 E

(A) 81 (B) 27 (c) 9 (d) 3 (E) 1
3 O/V $[8 |; G; U '_
5. Which of the following data
Is the structure the most widely used in Priority Queues?
! G1 P4 l0 e "n8 Q $ Q2 W
(A) heap (B) array
(C) bidirectional linked list (d) fig (e) vector 7 h t, Y .~ 9 H0 R (B9 I. A4 B, O

6. The following algorithm describes the (_ 1 h, | $} 1 V5 Z +? 8 K

Method (k> = 1 and K <= N ):
: Z, U, N5 M9 t
If K <= N-
K, from the linked list to the forward K-1 elements.
5 Z8 @/J; P + I6 O2 S
Otherwise, start from the end and go back to n-
K elements. +}-F,
S, F A1 R2 Z

What is the time cost of this algorithm ?; |)
L0 I + V, F (_ 'z

(A) θ (nlogn) (B) θ (max {k, n-k}) (c) θ (K + (n-k) 0 y M8 |! X0 W &/

(D) θ (max {k, K-n}) (e) θ (min {k, n-k}) 'H, D * B0 D, L6 T7? 7 J + d

7. How many edges does a graph contain ten vertices and each vertex has six degrees?
: Z $ | 3 X-H6 A-X! D. G
(A) 60 (B) 30
(C) 20 (d) 80 (e) 905 _ 5 X, T6 E4 '$ P/K6 n

8. Regular Expression L = x * (X | Yx + ). Which of the following strings is not signed by L "u'u9 p * E6 B9 @ # V2 ~

(A) x (B) xyxyx (c) xyx (d) yxx (e) Yx
1 D1 Z. d j (U9 Z-] + q
9. Read
The total time for preparing a disk drive for one piece of data includes
6x7 J8 J * R8 H3 R1 S9 J
(A) wait time
(B) Seek time (c) Transfer Time (d) wait time plus seek time: @; M3 Z "Z $ X,]-B2 J

(E) wait time plus seek time plus transfer time "J) z7 Q-r 'g9 Z" C & H

Ii. algorithm! Y. M8 y/
R "D & W

1. Print the content of a binary tree
.; C0 e $/7 P "N; ^

2. Find the first character that appears only once in a string. For example, abaccdeff, output B. + _ 0 K4 ^ ({(E8 |

3. Given an integer array whose length is n (the element has positive and negative values), calculate the sum of all elements.
1 B1 l "I" M6 x P/} 8 d
The largest subarray. Analysis and Calculation
Time-Space complexity. You do not need to write code. -
F9 _ * I $ T3 G6 J

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.