電機題解

113 台北科技大學 資料結構 考古題解答

題目(共 14 題)

I-14 分

Which of the following applications may use a stack?

a) A parentheses-balancing program.

b) Data Transfer between two asynchronous processes.

c) Tracking of local variables at run time.

d) Compiler Syntax Analyzer.

購買後顯示這題的詳解
I-24 分

Which of the following is not an advantage of trees?

a) Hierarchical structure b) Faster search c) Router algorithms d) Undo/Redo operations in a notepad

購買後顯示這題的詳解
I-34 分

Algorithms like merge sort, quick sort, and binary search are based on

a) Greedy algorithm b) Divide and Conquer algorithm c) Hash table d) Parsing

購買後顯示這題的詳解
I-44 分

Which of the following best approximates the ratio of the number of leaf nodes in a complete \(k\)-ary tree of depth \(n\)?

a) \(1-\frac1k\) b) \(1-\frac1n\) c) \(\frac1n\) d) \(\frac1k\)

購買後顯示這題的詳解
II-14 分

What is the value of the postfix expression 6 3 2 4 + − *?

購買後顯示這題的詳解
II-24 分
53445547275838894101
Fig. 1

Given a binary search tree in Fig. 1, insert 27, 15, 63, 99, 70, and 85 (in this order) into the binary search tree. What is the post-order traversal?

購買後顯示這題的詳解
II-34 分

What is the time complexity of the dynamic programming implementation of the longest common subsequence problem where the length of one string is “m” and the length of the other string is “n”?

購買後顯示這題的詳解
II-44 分

For an ordered list of 11 items, how many comparisons will a linear search need before it knows that a value is NOT in the list?

購買後顯示這題的詳解
II-58 分

Order the following functions by their growth rate from slowest to fastest: \(\sqrt n,\ n^{1.5},\ n^2,\ n\log n,\ n\log\log n,\ n\log^2n,\ 2^n,\ 2^{\log n}\).

購買後顯示這題的詳解
III-15 分

What does the following function do for a given Linked List with the first node as head?

void fun1(struct node* head){
  if(head == NULL)
    return;
  fun1(head->next);
  printf("%d ", head->data);
}
購買後顯示這題的詳解
III-25 分

Consider the singly linked list shown in Table I whose head is item R. Assume the item S is added physically to the bottom of the list and inserted logically between R and Q. Show the link column entry after insertion.

datalink
1L2
2P4
3R5
4BNull
5Q1
6

Table I.

購買後顯示這題的詳解
III-315 分

You have a hash table with 8 slots and the following hash function: \(h(k)=(3k+7)\bmod 8\) with collisions resolved by using chaining.

(a) What is the probability that the first 3 slots are unfilled after the first 3 insertions? (5 分)

(b) If you want to search for the key 5, what index is it could be located in the hash table? (5 分)

(c) What is the time complexity? (5 分)

購買後顯示這題的詳解
III-415 分

For the AOE (Activity on Edge) network described in Table II, answer the following questions:
[Note that state 1 is the starting state and state 10 is the goal state.]

(a) What is the earliest time the project can finish? (5 分)

(b) Please list all critical paths. (10 分)

ActivityFromToTimeActivityFromToTime
A1125A8453
A2135A9571
A3243A10584
A4346A116104
A5353A12795
A6464A13892
A7474A149102

Table II

購買後顯示這題的詳解
III-520 分

Read the following array A in the given order, and show the corresponding trees:

A 15, 3, 8, 2, 10, 7, 6, 18, 5

(a) Construct a binary search tree for array A. Draw the resulting tree. (5 分)

(b) Show the pre-order sequence of the obtained tree in (a). (5 分)

(c) Construct a MAX-heap using the Top-Down Strategy. Draw the resulting heap. (5 分)

(d) Sort the numbers using heap sort in ascending order from the Max-Heap in (c). (5 分)

購買後顯示這題的詳解

北科資料結構其他年度

115114112

113 學年度北科其他科目

工程數學線性代數

北科電機所全部考古題 →