電機題解

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

題目(共 14 題)

I-14 分

Which of the following NOT typically implemented using a stack data structure?

a) Undo/Redo operations in a text editor.

b) Queue management in a restaurant waiting system.

c) Function call management in program execution.

d) Syntax checking for matching parentheses in a compiler.

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

Which of the following is the most significant advantage of AVL trees over standard binary search trees (BST)?

a) Guaranteed O(log n) time complexity for search, insertion, and deletion operations

b) Uses less memory than a standard binary search tree

c) Allows duplicate keys to be stored more efficiently

d) Supports faster sequential access of elements than standard BST

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

Breadth-First Search (BFS) and Depth-First Search (DFS) algorithms are based on

a) Sorting techniques b) Graph traversal strategies c) Array manipulation d) Hash calculations

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

In a complete binary tree with \(n\) internal nodes, how many leaf nodes are there?

a) \(n\) b) \(2n\) c) \(n+1\) d) \(2n+1\)

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

What is the value of the postfix expression 10 5 + 2 * 4 / ?

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

Given a binary search tree in Fig. 1, insert 30, 45, 75, 85, 95, and 65 (in this order) into the binary search tree. What is the pre-order traversal?

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

What is the time complexity of breadth-first search on a graph with "V" vertices and "E" edges when using an adjacency list representation?

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

Order the following functions by their growth rate from slowest to fastest: \(O(n!),\ O(\sqrt n),\ n^2,\ O(n\log n),\ O(\log\log n),\ O(1),\ O(\log n),\ O(2^n)\).

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

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

datalink
1Z2
2W4
3X1
4VNull
5
6

Table I.

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

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 || head->next == NULL)
    return;
  struct node* temp = head->next;
  head->next = temp->next;
  free(temp);
}
購買後顯示這題的詳解
III-320 分

You have a hash table with 19 slots and the following hash function: \(h(k)=(k+10)\bmod 19\). Insert the following keys in order: 10, 29, 47, 38, 24, 5, 28, 9, 17.

(a) How many collisions occurred when using chaining versus linear probing for collision resolution? Compare and explain the difference. (6 分)

(b) If you want to search for key 19, analyze its possible position(s) under both chaining and linear probing methods. Which method would be more efficient for this search and why? (6 分)

(c) The density of the hash table is 47.4%. Explain how this density affects the search performance in chaining and linear probing methods. Which method would you recommend for this density and why? (8 分)

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

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

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

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

ActivityFromToTimeActivityFromToTime
A1124A7465
A2136A8563
A3243A9576
A4255A10684
A5342A11782
A6354

Table II

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

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

A 20, 7, 15, 4, 12, 9, 11, 25, 6

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

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

(c) Construct a MIN-heap for these numbers using the Top-Down Strategy. Draw the resulting heap. (5 分)

(d) Show heap sort in ascending order using the MIN-Heap in (c). (5 分)

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

Write a pseudo-code for finding common elements in two sorted arrays arr1[] and arr2[] of size m and n, respectively, where the common elements should be printed in sorted order. The solution should have a time complexity of O(m + n).

購買後顯示這題的詳解

北科資料結構其他年度

115113112

114 學年度北科其他科目

工程數學線性代數

北科電機所全部考古題 →