<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="index_utf8.xsl"?>
<article>
<search>http://www.csie.dyu.edu.tw/~spring/Exercises/search1_utf8.php</search>
<condition>file=index_utf8.xml</condition>
<title>題庫</title>

<head>
<course>科目</course>
<about>相關</about>
<source>來源</source>
<date>日期</date>
<type>題目類型</type>
<content>題目內容</content>
<answer>解答</answer>
<comment>備註</comment>
</head>
<record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<source>賴映潔</source>
<date>Tue May 12 8:36:21 2009</date>
<type>設計grammar</type>
<content>5.1.8 (g) Find context-free grammars for L = {anbmck:k ≠ n + m},n≥ 0, m ≥ 0, k ≥ 0.</content>
<answer>formal languages_60213659.odp</answer>
<comment>習題5.1.8(g)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<source>spring</source>
<date>Fri Apr 10 10:26:13 2009</date>
<type>設計grammar</type>
<content>5.1.7 (c) find context-free grammars for the following languages
 (c) L = anbm : n ≠ 2m} (n ≥ 0, m ≥ 0)</content>
<answer>formal languages_57455451.odp</answer>
<comment>習題 5.1.7(c)</comment>
</record><record>
<course>algorithms</course>
<about>binary search tree</about>
<source>F9506037</source>
<date>Sat Mar 14 9:44:53 2009</date>
<type>證明</type>
<content>12.3-5 Is the operation of deletion \"commutative\" in
the sense that deleting x and the y from a binary
search tree leaves the same tree as deleting y
and then x ? Argue why it is or give a
counterexample.</content>
<answer>algorithms_55120171.odp</answer>
<comment>習題12.3-5</comment>
</record><record>
<course>algorithms</course>
<about>binary search tree</about>
<source>F9506049</source>
<date>Sat Mar 14 9:28:53 2009</date>
<type>證明</type>
<content>12.1-5 Argue that since sorting n elements takes Ω(n lg n) time in the worst case in the comparison model, any comparison-based algorithm for constructing a binary search tree from an arbitrary list of n elements takes Ω(n lg n) time in the worst case.</content>
<answer>algorithms_55119211.odp</answer>
<comment>習題12.1-5</comment>
</record><record>
<course>algorithms</course>
<about>Hash Tables</about>
<about>open addressing</about>
<source>F9506237</source>
<date>Sat Mar 14 9:24:40 2009</date>
<type>計算</type>
<content>11.4-4 Consider an open-address hash table with uniform hashing. Give upper bounds on the expected number of probes in an unsuccessful search and on the expected number of probes in a successful search when the load factor is 3/4 and when it is 7/8.</content>
<answer>algorithms_55118958.odp</answer>
<comment>習題11.4-4</comment>
</record><record>
<course>algorithms</course>
<about>binary search tree</about>
<about>red-black trees</about>
<source>F9506219</source>
<date>Sat Mar 14 9:20:51 2009</date>
<type>問答</type>
<content>13.3-1 In line 16 of RB-INSERT, we set the color of the newly inserted node z to red. Notice that if we had chosen to set z\'s color to black, then property 4 of a red-black tree would not be violated. Why didn\'t we choose to set z\'s color to black?</content>
<answer>algorithms_55118729.odp</answer>
<comment>習題13.3-1</comment>
</record><record>
<course>algorithms</course>
<about>binary search tree</about>
<about>red-black trees</about>
<source>F9506011</source>
<date>Sat Mar 14 9:18:12 2009</date>
<type>證明</type>
<content>13.1-3 Let us define a relaxed red-black tree as a binary
search tree that satisfies red-black properties 1, 3, 4,
and 5. In other words, the root may be either red or
black. Consider a relaxed red-black tree T whose root
is red. If we color the root of T black but make no
other changes to T, is the resulting tree a red-black
tree?</content>
<answer>algorithms_55118570.odp</answer>
<comment>習題13.1-3</comment>
</record><record>
<course>algorithms</course>
<about>stack</about>
<about>queue</about>
<source>F9506055</source>
<date>Sat Mar 14 9:13:35 2009</date>
<type>設計演算法</type>
<content>10.1-7 Show how to implement a stack using two queues. Analyze the running time of the stack operations.</content>
<answer>algorithms_55118293.odp</answer>
<comment>習題10.1-7</comment>
</record><record>
<course>algorithms</course>
<about>linked list</about>
<source>李育德 賴宗佑 林哲賢 陳炯桓</source>
<date>Sat Mar 14 9:01:40 2009</date>
<type>基本性質</type>
<content>Problem 10-1 Comparisons among lists
For each of the four types of lists in the following table, what is the asymptotic worst-case running time for each dynamic-set operation listed?</content>
<answer>algorithms_55117577.odp</answer>
<comment>Problem 10-1</comment>
</record><record>
<course>algorithms</course>
<about>red-black trees</about>
<about>binary search tree</about>
<source>曾一平</source>
<date>Sat Mar 14 8:55:55 2009</date>
<type>基本性質</type>
<content>13.2-3 Let a, b, and c be arbitrary nodes in subtrees α,
β, and γ, respectively, in the left tree of Figure 13.2.
How do the depths of a, b, and c change when a left
rotation is performed on nodes x in the figure?</content>
<answer>algorithms_55117233.odp</answer>
<comment>習題13.2-3</comment>
</record><record>
<course>algorithms</course>
<about>Hash Tables</about>
<source>F9506246</source>
<date>Sat Mar 14 8:52:37 2009</date>
<type>執行演算法</type>
<content>11.2-2 Demonstrate the insertion of the 
keys 5, 28, 19, 15, 20, 33, 12, 17, 10 into 
a hash table with collisions resolved by 
chaining. Let the table have 9 slots, and 
let the hash function be h(k) = k mod 9</content>
<answer>algorithms_55117035.odp</answer>
<comment>習題11.2-2</comment>
</record><record>
<course>algorithms</course>
<about>complexity</about>
<about>big-O</about>
<source>spring</source>
<date>Sat Mar 7 11:28:23 2009</date>
<type>證明</type>
<content>3.1-4 Is 2n+1 = O(2n)? Is 22n = O(2n)?
(請證明您的答案)</content>
<answer>algorithms_54521581.odp</answer>
<comment>習題3.1-4</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<about>Greibach normal form</about>
<source>f9306023</source>
<date>Fri Feb 27 16:07:20 2009</date>
<type>設計grammar</type>
<content>A6-2 Find a Greibach normal-form grammar equivalent tothe following CFG: 
S ->AB, A -> BS | b, B -> SA |a</content>
<answer>formal languages_53847118.odp</answer>
<comment>習題A6-2</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<source>胡偉諄</source>
<date>Fri Feb 27 16:04:50 2009</date>
<type>設計grammar</type>
<content>A5-3 Construct a context-free grammar that generates L = {xcn | x ∈ {a, b}*, na(x) + nb(x) ≥ n}.</content>
<answer>formal languages_53846968.odp</answer>
<comment>習題A5-3</comment>
</record><record>
<course>formal languages</course>
<about>set</about>
<source>洪喜音</source>
<date>Fri Feb 27 15:49:21 2009</date>
<type>證明</type>
<content>A1-1. Let L1 and L2 be two languages and |L1| = m, |L2| = n. Is it true that |L1L2| = mn for all L1, L2?</content>
<answer>formal languages_53846039.odp</answer>
<comment>習題A1-1</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<about>transforming grammars</about>
<source>陳羿亘</source>
<date>Fri Feb 27 12:39:36 2009</date>
<type>設計grammar</type>
<content>6.1.24 Use the result of the preceding exercise to rewrite
the grammar
A → Aa | aBc | λ
B → Bb | bc
So that it no longer has productions of the form A →Ax or B→Bx</content>
<answer>formal languages_53834654.odp</answer>
<comment>習題6.1.24</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<about>Chomsky normal form</about>
<source>F9406228</source>
<date>Fri Feb 27 12:35:04 2009</date>
<type>設計grammar</type>
<content>6.2.3 Transform the grammar S -> aSaA | A , A->abA|b into Chomsky normal form.</content>
<answer>formal languages_53834382.odp</answer>
<comment>習題6.2.3</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<about>Chomsky normal form</about>
<source>朱致宏</source>
<date>Fri Feb 27 12:27:15 2009</date>
<type>設計grammar</type>
<content>6.2.2 Convert the grammar S → aSb | ab into Chomsky
normal form.</content>
<answer>formal languages_53833913.odp</answer>
<comment>習題6.2.2</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<about>transforming grammars</about>
<source>賴映潔</source>
<date>Fri Feb 27 12:25:16 2009</date>
<type>證明</type>
<content>6.1.16 Let G be a grammar without λ-production, but possibly with some unit-productions. Show that the construction of Theorem 6.4 does not then  introduce any λ-productions.</content>
<answer>formal languages_53833794.odp</answer>
<comment>習題6.1.16</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>pushdown automata</about>
<source>F9406235</source>
<date>Fri Feb 27 12:19:18 2009</date>
<type>設計automaton</type>
<content>7.1.4 (i) Construct an npda that accepts the language L = {w : na(w) + nb(w) = nc(w)} on = {a, b, c}.</content>
<answer>formal languages_53833436.odp</answer>
<comment>習題7.1.4(i)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<source>F9206101</source>
<date>Fri Feb 27 12:16:28 2009</date>
<type>設計grammar</type>
<content>5.1.18 Show that the language L = { w1cw2 : w1,w2 ∈{a,b}+,
w1 ≠ w2R} , with Σ = { a,b,c }, is context-free.</content>
<answer>formal languages_53833266.odp</answer>
<comment>習題5.1.18</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<about>ambiguous</about>
<source>朱致宏</source>
<date>Fri Feb 27 12:08:54 2009</date>
<type>證明</type>
<content>5.2.13 Show that the following grammar is ambiguous.
            S → aSbS | bSaS |  λ</content>
<answer>formal languages_53832812.odp</answer>
<comment>習題5.2.13</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<source>f9306023</source>
<date>Fri Feb 27 12:06:22 2009</date>
<type>設計grammar</type>
<content>5.1.15 Show that the following language is context-free. L ={uvwvR : u, v, w ∈ {a, b}+, |u| = |w| = 2}.</content>
<answer>formal languages_53832660.odp</answer>
<comment>習題5.1.15</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<about>Greibach normal form</about>
<source>林祐誼</source>
<date>Fri Feb 27 11:18:46 2009</date>
<type>設計grammar</type>
<content>6.2.13 Convert the grammar 
  S → Abb | a,
  A → aaA | B,
  B → bAb
Into Greibach normal form.</content>
<answer>formal languages_53829803.odp</answer>
<comment>習題6.2.13</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<source>f9406228</source>
<date>Fri Feb 27 11:15:52 2009</date>
<type>設計grammar</type>
<content>5.1.8(c) Find context-free grammars for L = {anbmck: k = n + m}, n ≥ 0, m ≥ 0, k ≥ 0.</content>
<answer>formal languages_53829629.odp</answer>
<comment>習題5.1.8(c)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<about>transforming grammars</about>
<source>胡偉諄</source>
<date>Fri Feb 27 11:14:00 2009</date>
<type>設計grammar</type>
<content>6.1.6 Eliminate useless productions from
S → a | aA | B | C,
A → aB | λ,
B → Aa,
C → cCD,
D → ddd.</content>
<answer>formal languages_53829518.odp</answer>
<comment>習題6.1.6</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<source>F9406234</source>
<date>Fri Feb 27 11:11:50 2009</date>
<type>設計grammar</type>
<content>5.1.13 (c) Let L = {anbn: n ≥ 0}. Show that  the complement of L and L* are context-free.</content>
<answer>formal languages_53829388.odp</answer>
<comment>習題5.1.13(c)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<about>Greibach normal form</about>
<source>F9206101</source>
<date>Fri Feb 27 11:04:44 2009</date>
<type>設計grammar</type>
<content>6.2.10 Convert the grammar	S → aSb | bSa | a | b 	into
Greibach normal form.</content>
<answer>formal languages_53828962.odp</answer>
<comment>習題6.2.10</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<about>transforming grammars</about>
<source>洪喜音</source>
<date>Fri Feb 27 11:02:16 2009</date>
<type>描述語言</type>
<content>6.1.5 Eliminate all useless productions from the grammar
S → aS | Ab,
A →bA,
B  →AA.
What language does this grammar generate?</content>
<answer>formal languages_53828814.odp</answer>
<comment>習題6.1.5</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>pumping lemma</about>
<source>F9306038</source>
<date>Fri Feb 27 10:59:24 2009</date>
<type>證明</type>
<content>4.3.7 Show that the language L = 
{anbn: n ≥ 0} ∪ {anbn+1: n ≥ 0} ∪ 
{anbn+2: n ≥ 0}is not regular.</content>
<answer>formal languages_53828641.pdf</answer>
<comment>習題4.3.7</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>pumping lemma</about>
<source>曾愷銘</source>
<date>Fri Feb 27 10:56:52 2009</date>
<type>證明</type>
<content>4.3.4 f) Prove that L= {ww: w Î{a, b}*} is not regular.</content>
<answer>formal languages_53828490.odp</answer>
<comment>習題4.3.4(f)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<source>F9406207</source>
<date>Fri Feb 27 10:52:55 2009</date>
<type>證明</type>
<content>4.3.6 a) Determine whether or not L = {anbn: n ≥ 1} ∪ {anbm : n ≥ 1, m ≥ 1} is regular.</content>
<answer>formal languages_53828253.odp</answer>
<comment>習題4.3.6(a)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>pumping lemma</about>
<source>林祐誼</source>
<date>Fri Feb 27 10:50:33 2009</date>
<type>證明</type>
<content>4.3.15g) L={anbl : | n-l | = 2}是Regular Language嗎?
請證明。</content>
<answer>formal languages_53828111.odp</answer>
<comment>習題4.3.15(g)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>nfa</about>
<source>f9306023</source>
<date>Fri Feb 27 10:47:26 2009</date>
<type>設計automaton</type>
<content>4.1.2 b) Find the nfa that accept L(ab*a*) ∩ L(a*b*a)</content>
<answer>formal languages_53827924.odp</answer>
<comment>習題4.1.2(b)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>pumping lemma</about>
<source>林柏存</source>
<date>Fri Feb 27 10:43:52 2009</date>
<type>證明</type>
<content>4.3.4 g) Prove that L= {w w w w r : w ∈ {a, b}*} is not regular.</content>
<answer>formal languages_53827710.odp</answer>
<comment>習題4.3.4(g)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<source>蔡學仁</source>
<date>Fri Feb 27 10:40:14 2009</date>
<type>設計grammar</type>
<content>5.1.11 Find a context-free grammar for Σ = {a, b} for the languageL = {anwwRbn: w ∈ Σ*, n ≥ 1}</content>
<answer>formal languages_53827492.odp</answer>
<comment>習題5.1.11</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammar</about>
<source>陳羿亘</source>
<date>Fri Feb 27 10:26:13 2009</date>
<type>設計grammar</type>
<content>5.1.8 (b) Find context-free grammars for L = {anbmck: n = m or m ≠ k}, n ≥ 0, m ≥ 0, k ≥ 0.</content>
<answer>formal languages_53826651.odp</answer>
<comment>習題5.1.8(b)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>s-grammar</about>
<source>洪喜音</source>
<date>Fri Feb 27 8:59:11 2009</date>
<type>設計grammar</type>
<content>5.2.1 Find an s-grammar for L(aaa*b+b).</content>
<answer>formal languages_53821429.odp</answer>
<comment>習題5.2.1</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<source>胡偉諄</source>
<date>Fri Feb 27 8:54:15 2009</date>
<type>設計演算法</type>
<content>4.2.7 Exhibit an algorithm that, given any three regular languages,L,L1,L2,determines whether or not L=L1L2.</content>
<answer>formal languages_53821133.odp</answer>
<comment>習題4.2.7</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>heap sort</about>
<source>F9406009</source>
<date>Thu Feb 26 17:51:18 2009</date>
<type>問答</type>
<content>6.2-4 What is the effect of calling Max-Heapify(A, i) for i> heap-size[A]/2?</content>
<answer>algorithms_53766956.odp</answer>
<comment>習題6.2-4</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<source>f9406241</source>
<date>Thu Feb 26 17:48:02 2009</date>
<type>基本性質</type>
<content>8.3-2 Which of the following sorting algorithms are stable: insertion sort, merge sort, heapsort, and quicksort? Give a simple scheme that makes any sorting algorithm stable. How much additional time and space does your scheme entail?</content>
<answer>algorithms_53766760.odt</answer>
<comment>習題8.3-2</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>bucket-sort</about>
<source>f9506803</source>
<date>Thu Feb 26 17:42:52 2009</date>
<type>執行演算法</type>
<content>8.4-1 Using Figure 8.4 as a model, illustrate the operation of Bucket-Sort on the array A = 〈.79, .13, .16, .64, .39, .20, .89, .53, .71, .42〉.</content>
<answer>algorithms_53766450.odp</answer>
<comment>習題8.4-1</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>lower bound</about>
<source>林煥傑</source>
<date>Thu Feb 26 17:38:59 2009</date>
<type>證明</type>
<content>9.1-1 Show that the second smallest of n elements can be found with n + ⌊lg n – 2⌋ comparisons in the worst case. (Hint: Also find the smallest element.)</content>
<answer>algorithms_53766217.odp</answer>
<comment>習題9.1-1</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>heap sort</about>
<source>桂子龍</source>
<date>Thu Feb 26 17:34:36 2009</date>
<type>證明</type>
<content>6.1-2 Show that an n-element heap has height ⌊lg n⌋</content>
<answer>algorithms_53765954.odp</answer>
<comment>習題6.1-2</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>heap sort</about>
<source>F9506213</source>
<date>Thu Feb 26 17:30:33 2009</date>
<type>證明</type>
<content>6.1-7 Show that, with the array representation for storing an n-element heap, the leaves are the nodes indexed by  ⌊n/2⌋ + 1, ⌊n/2⌋ + 2, ..., n.</content>
<answer>algorithms_53765711.odp</answer>
<comment>習題6.1-7</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>heap sort</about>
<source>F9506237</source>
<date>Thu Feb 26 17:23:43 2009</date>
<type>問答</type>
<content>6.2-3 What is the effect of calling Max-Heapify(A, i) when the element A[i] is larger than its children?</content>
<answer>algorithms_53765301.odp</answer>
<comment>習題6.2-3</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>counting sort</about>
<source>F9506029</source>
<date>Thu Feb 26 17:00:52 2009</date>
<type>證明</type>
<content>8.2-3 Suppose that the for loop header in line 9 of the Counting-Sort procedure is rewritten as
9 for j ← 1 to length[A]
Show that the algorithm still works properly. Is the modified algorithm stable?</content>
<answer>algorithms_53763930.pdf</answer>
<comment>習題9.2-3</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>selection</about>
<source>F9506011</source>
<date>Thu Feb 26 16:57:38 2009</date>
<type>設計演算法</type>
<content>9.3-1 In the algorithm Select, the input elements are divided into groups of 5. Will the algorithm work in linear time if they are divided into groups of 7? Argue that Select does not run in linear time if groups of 3 are used.</content>
<answer>algorithms_53763736.odp</answer>
<comment>習題9.3-1</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<source>F9506229</source>
<date>Thu Feb 26 16:53:20 2009</date>
<type>證明</type>
<content>8.1-4 You are given a sequence of n elements to sort. The input sequence consists of n/k subsequences, each containing k elements. The elements in a given subsequence are all smaller than the elements in the succeeding subsequence and larger than the elements in the preceding subsequence. Thus, all that is needed to sort the whole sequence of length n is to sort the k elements in each of the n/k subsequences. Show an Ω(n lg k) lower bound on the number of comparisons needed to solve this variant of the sorting problem. (Hint: It is not rigorous to simply combine the lower bounds for the individual subsequences.)</content>
<answer>algorithms_53763478.pdf</answer>
<comment>習題8.1-4</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>heap sort</about>
<source>F9506035</source>
<date>Thu Feb 26 16:49:19 2009</date>
<type>time complexity</type>
<content>6.2-6 Show that the worst-case running time of Max-
Heapify on a heap of size n is Ω(lg n).</content>
<answer>algorithms_53763237.pdf</answer>
<comment>習題6.2-6</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>heap sort</about>
<source>張文龍</source>
<date>Thu Feb 26 16:46:15 2009</date>
<type>基本性質</type>
<content>6.1-4  Where in a max-heap might the smallest element 
reside, assuming that all elements are distinct?</content>
<answer>algorithms_53763053.odp</answer>
<comment>習題6.1-4</comment>
</record><record>
<course>algorithms</course>
<about>sort</about>
<about>heap sort</about>
<source>王立恩</source>
<date>Thu Feb 26 16:41:24 2009</date>
<type>修改演算法</type>
<content>6.2-5 The code for Max-Heapify is quite efficient in terms of constant factors, except possibly for the recursive call in line 10, which might cause some compilers to produce inefficient code. Write an efficient Max-Heapify that uses an iterative contro construct (a loop) instead of recursion.</content>
<answer>algorithms_53762762.odt</answer>
<comment>習題6.2-5</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>heapsort</about>
<source>f9506021</source>
<date>Thu Feb 26 6:27:57 2009</date>
<type>分析演算法</type>
<content>6.4-3 What is the running time of heapsort on an array A of length n that is already sorted in increasing order? What about decreasing order?</content>
<answer>algorithms_53725955.odp</answer>
<comment>習題 6.4-3</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>bucket-sort</about>
<about>time complexity</about>
<source>f9506015</source>
<date>Thu Feb 26 6:21:19 2009</date>
<type>修改演算法</type>
<content>8.4-2 What is the worst-case running time for the bucket-sort algorithm? What simple change to the algorithm preserves its linear expected running time and makes its worst-case running time O(nlogn)?</content>
<answer>algorithms_53725557.odp</answer>
<comment>習題 8.4-2</comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>heap</about>
<source>曾一平</source>
<date>Thu Feb 26 6:16:22 2009</date>
<type>執行演算法</type>
<content>6.5-2 Illustrate the operation of MAX-HEAP-INSERT(A, 10) on the heap A={15, 13, 9, 5, 12, 8, 7, 4, 0, 6, 2, 1}. Use the heap of Fig6,5 as a model for the HEAP-INCREASE-KEY call.</content>
<answer>algorithms_53725260.odp</answer>
<comment>習題 6.5-2</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>pushdown automata</about>
<about>npda</about>
<source>spring</source>
<date>Wed May 28 9:56:03 2008</date>
<type>設計 automaton</type>
<content>7.1.4 (k) Construct an npda that accepts the language L = {w : na(w) ＜ nb(w)} on Σ = {a, b, c}.</content>
<answer>formal languages_30064841.odp</answer>
<comment>習題7.1.4 k)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>pushdown automata</about>
<about>npda</about>
<source>spring</source>
<date>Wed May 28 9:46:54 2008</date>
<type>設計 automaton</type>
<content>7.1.4 (d) Construct an npda that accepts the language L = {anbn+mcm : n ≥ 0, m ≥ 0}.</content>
<answer>formal languages_30064293.odp</answer>
<comment>習題7.1.4 d)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>pushdown automata</about>
<source>spring</source>
<date>Wed May 21 9:58:56 2008</date>
<type>設計 automaton</type>
<content>7.1.4 (e) Construct an npda that accepts the language L = {a3bncn:n ≥ 0}.</content>
<answer>formal languages_29460213.odp</answer>
<comment>習題7.1.4 e)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>pushdown automata</about>
<source>李京釜</source>
<date>Wed May 21 9:52:25 2008</date>
<type>設計 automaton</type>
<content>7.1.4(b) Construct an npda that accepts the language L = {wcwR : w ∈ {a, b}* }</content>
<answer>formal languages_29459823.odp</answer>
<comment>習題7.1.4 b)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>pushdown automata</about>
<source>spring</source>
<date>Wed May 21 9:46:04 2008</date>
<type>設計 automaton</type>
<content>7.1.4 (g) Construct an npda that accepts the language L = {w :na(w) = nb(w) + 1} on Σ = {a, b, c}.</content>
<answer>formal languages_29459443.odp</answer>
<comment>習題7.1.4 g)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>pushdown automata</about>
<about>regular expression</about>
<source>spring</source>
<date>Wed May 21 9:40:25 2008</date>
<type>設計 automaton</type>
<content>7.1.3 (c) Construct an npda that accepts the regular languageL(aaa*b) ∪ L(aab*aba*)</content>
<answer>formal languages_29459103.odp</answer>
<comment>習題7.1.3 c)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammars</about>
<source>陳柏緯</source>
<date>Wed May 14 14:44:38 2008</date>
<type>設計 grammars</type>
<content>5.1.8 (d) Find context-free grammars for 
L = {anbmck: k = n + 2m,n ≥ 0, m ≥ 0, k ≥ 
0}.</content>
<answer>formal languages_28872556.odp</answer>
<comment>習題 5.1.8 d)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>黃弘碩</source>
<date>Wed May 14 10:11:03 2008</date>
<type>設計 regular expression</type>
<content>3.1.6 d) Give regular expressions for complement of the 
language L2 = {anbm :  n 〈 3, m ≤ 4}.</content>
<answer>formal languages_28856141.odp</answer>
<comment>習題 3.1.6 d)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular grammars</about>
<source>吳威毅</source>
<date>Wed May 14 10:02:56 2008</date>
<type>設計 grammars</type>
<content>3.3.13 e) Find regular grammars for L = {w: |na(w) - nb(w)| is odd} on {a, b}.</content>
<answer>formal languages_28855654.odp</answer>
<comment>習題 3.3.13 e)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>柯衍慶</source>
<date>Wed May 14 9:57:31 2008</date>
<type>設計 regular expression</type>
<content>3.1.28 Find a regular expression for all bit strings, with leading bit 1, interpreted as a binary integer, with values not between 10 and 30.</content>
<answer>formal languages_28855329.odp</answer>
<comment>習題 3.1.28</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>廖本宇</source>
<date>Wed May 14 9:51:13 2008</date>
<type>設計 regular expression</type>
<content>3.2.13 d) Find a regular expression for L = {w: 2na(w)+3nb(w) is even} on {a, b}.</content>
<answer>formal languages_28854951.odp</answer>
<comment>習題 3.2.13 d)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>朱致宏</source>
<date>Wed May 14 9:45:15 2008</date>
<type>設計 regular expression</type>
<content>3.1.17 a) Write regular expressions for all strings ending in  01 on Σ= {0, 1}.</content>
<answer>formal languages_28854593.odp</answer>
<comment>習題 3.1.17 a)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular grammars</about>
<source>林祐誼</source>
<date>Wed May 14 9:38:31 2008</date>
<type>設計 grammars</type>
<content>3.3.12 Find a regular grammar that generates the language L={w ∈ {a,b}*:na(w)+3nb(w) is even}.</content>
<answer>formal languages_28854188.odp</answer>
<comment>習題 3.3.12</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<about>DFA</about>
<source>簡裕哲</source>
<date>Wed May 14 9:31:55 2008</date>
<type>設計 automaton</type>
<content>3.2.4 d) Find a dfa that accept L(((aa*)*b)*).</content>
<answer>formal languages_28853793.odp</answer>
<comment>習題 3.2.4 d)</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>Greibach normal form</about>
<source>spring</source>
<date>Wed May 7 10:11:30 2008</date>
<type>設計 grammars</type>
<content>6.2.11 Convert the following grammar into Greibach normal form.
S → aSb | ab.</content>
<answer>formal languages_28251368.odp</answer>
<comment>習題6.2.11</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>λ-productions</about>
<about>unit-productions</about>
<source>spring</source>
<date>Wed May 7 10:09:10 2008</date>
<type>證明</type>
<content>Let G = (V, T, S, P) be any context-free grammar without any λ-productions or unit-productions. Let k be the maximum number of symbols on the right of any production in P. Show that there is an equivalent grammar in Chomsky normal form with no more than (k-1) |P| + |T| production rules.</content>
<answer>formal languages_28251228.odp</answer>
<comment>習題6.2.6</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>CYK algorithm</about>
<source>洪惠美</source>
<date>Wed May 7 10:03:29 2008</date>
<type>執行演算法</type>
<content>Use the CYK algorithm to determine whether the strings aabb, aabba, and abbbb are in the language generated by the grammar in Example 6.11.</content>
<answer>formal languages_28250887.odp</answer>
<comment>習題6.3.1</comment>
</record><record>
<course>formal languages</course>
<about>context free languages</about>
<about>λ-productions</about>
<source>spring</source>
<date>Wed May 7 6:21:40 2008</date>
<type>設計 grammar</type>
<content>6.1.7 Eliminate λ-productions from
	S → AaB | aaB,
	A → λ,
	B → bbA | λ.</content>
<answer>formal languages_28237578.odp</answer>
<comment>習題 6.1.7</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>s-grammars</about>
<about>ambiguous</about>
<source>spring</source>
<date>Fri Apr 25 17:16:00 2008</date>
<type>證明</type>
<content>5.2.4 Show that every s-grammar is unambiguous.</content>
<answer>formal languages_27240038.odp</answer>
<comment>習題5.2.4</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammars</about>
<source>spring</source>
<date>Fri Apr 25 17:11:32 2008</date>
<type>設計 grammars</type>
<content>5.1.7 (f) Find context-free grammars for L = {w ∈ {a, b}*: na(v) ≥ nb(v), where v is any prefix of w}, n ≥ 0, m ≥ 0.</content>
<answer>formal languages_27239770.odp</answer>
<comment>習題5.1.7 f)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>pumping lemma</about>
<source>洪惠美</source>
<date>Fri Apr 25 16:45:18 2008</date>
<type>證明</type>
<content>4.3.5 b) Determine whether or not L = {an : n is not prime number} on Σ = {a} is regular.</content>
<answer>formal languages_27238196.odp</answer>
<comment>習題4.3.15 b)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>pumping lemma</about>
<source>spring</source>
<date>Fri Apr 25 16:34:10 2008</date>
<type>證明</type>
<content>4.3.15 e) L = {anbl : n ≤ l ≤ 2n} 是 regular language 嗎？請證明。</content>
<answer>formal languages_27237528.odp</answer>
<comment>習題4.3.15 e)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>pumping lemma</about>
<source>吳忠融</source>
<date>Fri Apr 25 16:28:42 2008</date>
<type>證明</type>
<content>4.3.15 c) L = {anbl : n/l is an integer} 是 regular language 嗎？請證明。</content>
<answer>formal languages_27237200.odp</answer>
<comment>習題4.3.15 c)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular grammars</about>
<about>regular expression</about>
<source>spring</source>
<date>Fri Apr 25 13:01:10 2008</date>
<type>設計 grammars</type>
<content>3.3.2 Find a regular grammar that generates the language
L(aa*(ab+a)*)</content>
<answer>formal languages_27224748.odp</answer>
<comment>習題3.3.2</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular grammars</about>
<about>DFA</about>
<source>何振剛</source>
<date>Fri Apr 25 12:57:06 2008</date>
<type>設計 automaton</type>
<content>3.3.1 Construct a dfa that accepts the language generated by the grammar
S → abA,
A → baB,
B → aA | bb.</content>
<answer>formal languages_27224503.odp</answer>
<comment>習題3.3.1</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<about>DFA</about>
<source>spring</source>
<date>Fri Apr 25 12:28:44 2008</date>
<type>設計 automaton</type>
<content>3.2.4 b) Find a dfa that accept L(ab(a+ab)*(a+aa)).</content>
<answer>formal languages_27222802.odp</answer>
<comment>習題3.2.4 b)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>洪惠美</source>
<date>Fri Apr 25 11:43:01 2008</date>
<type>設計 regular expression</type>
<content>3.2.13 c) Find a regular expression for L = {w: (na(w) - nb(w)) mod 3 ≠ 0} on {a, b}.</content>
<answer>formal languages_27220059.odp</answer>
<comment>習題3.2.13 c)</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>Quicksort</about>
<source>spring</source>
<date>Fri Apr 25 11:20:55 2008</date>
<type>翻譯</type>
<content>請寫出下列英文的中文大意
The running time of quicksort depends on whether the partition is balanced or unbalanced, and this in turn depends on which elements are used for partitioning. If the partitioning is balanced, the algorithm runs asymptotically as fast as merge sort. If the partitioning is unbalanced, however, it can run asymptotically as slowly as insertion sort.</content>
<answer>algorithms_27218733.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>counting sort</about>
<source>spring</source>
<date>Fri Apr 25 11:19:28 2008</date>
<type>執行演算法</type>
<content>Perform the operation of Counting-Sort on the array A = 6, 5, 2, 3, 2, 4, 4, 2, 1, 7, 3.要寫下陣列 C 的三個主要內容與最後陣列 B 的內容。</content>
<answer>algorithms_27218646.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>stable</about>
<about>in place</about>
<about>average case</about>
<source>spring</source>
<date>Fri Apr 25 11:18:10 2008</date>
<type>計算</type>
<content>Fill the following table.</content>
<answer>algorithms_27218568.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>Quicksort</about>
<about>Partition</about>
<source>spring</source>
<date>Fri Apr 25 11:15:53 2008</date>
<type>執行演算法</type>
<content>Perform the operation of Partition on the array A = 〈13, 19, 9, 5, 12, 8, 7, 4, 11, 2, 6,10〉.</content>
<answer>algorithms_27218431.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>heap sort</about>
<about>heap</about>
<source>spring</source>
<date>Fri Apr 25 11:14:22 2008</date>
<type>執行演算法</type>
<content>請用 heap sort 的方式來將 〈13, 2, 25, 7, 17, 20〉 作遞減排序
a)請用 min-heapify 將 heap 建出來。寫出調整每一個元素後的情形。
b)寫出建完 heap 後的排序過程，寫出搬走每個元素、調整完後的結果。</content>
<answer>algorithms_27218340.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<about>Master Theorem</about>
<source>spring</source>
<date>Fri Apr 25 11:12:02 2008</date>
<type>計算</type>
<content>Give asymptotic upper and lower bounds for T(n) in each of the following recurrences.
a. T(n) = T(n-1) + 1/n.
b. T(n) = T(n-1) + lg n.
c. T(n) = 7T(n/2) + n2.
d. T(n) = 16T(n/4) + n2.
e. T(n) = 7T(n/3) + n2.
f. T(n) = T(n-1) + n.</content>
<answer>algorithms_27218200.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<source>spring</source>
<date>Fri Apr 25 11:08:38 2008</date>
<type>計算</type>
<content>Rank the following functions by order of growth; that is, find an arrangement g1, g2, ..., g15 of the functions satisfying g1 = (g2), g2 = (g3), ..., g14 = (g15).
n2, n!, (lg n)!, n3, lg2n, lg(n!), 22n, 2nn, n2n, nlg lgn, (lg n)lg n, 4lg n, 2n, n lg n, 22n+1</content>
<answer>algorithms_27217996.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>selection sort</about>
<about>insertion sort</about>
<source>spring</source>
<date>Fri Apr 25 11:06:10 2008</date>
<type>執行演算法</type>
<content>請分別使用 selection sorting 、insertion sort的方式對 〈35, 32, 24, 33, 18, 11, 15〉作遞增排序；寫下每一個元素被排好後的情形。</content>
<answer>algorithms_27217848.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>time complexity</about>
<about>heap</about>
<about>Theta</about>
<about>Big O</about>
<source>spring</source>
<date>Fri Apr 25 11:04:39 2008</date>
<type>是非題</type>
<content>是非題
f(n) + g(n) = (max(f(n), g(n))).
f(n) = O(g(n)  g(n) = O(f(n)).
An array that is sorted in non-decreasing order is a min-heap.
The sequence 〈23, 17, 14, 6, 13, 10, 11, 5, 4, 12〉 is a max-heap.
The time complexity of the best case of heap sort is O(n).</content>
<answer>algorithms_27217757.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>counting sort</about>
<source>spring</source>
<date>Fri Apr 25 10:57:12 2008</date>
<type>翻譯</type>
<content>請寫出下列英文的中文大意
The basic idea of counting sort is to determine, for each input element x, the number of elements less than x. This information can be used to place element x directly into its position in the output array. For example, if there are 17 elements less than x, then x belongs in output position 18.</content>
<answer>algorithms_27217310.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>radix sort</about>
<source>spring</source>
<date>Fri Apr 25 10:55:37 2008</date>
<type>執行演算法</type>
<content>Sort the following number in descending order with Radix Sort: 3852, 4621, 1357, 2489, 8543, 5781, 8799, 1076, 4893, 3651.</content>
<answer>algorithms_27217215.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>stable</about>
<about>in place</about>
<about>worst case</about>
<source>spring</source>
<date>Fri Apr 25 10:54:00 2008</date>
<type>基本性質</type>
<content>Fill the following table.</content>
<answer>algorithms_27217118.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>Quicksort</about>
<about>Partition</about>
<source>spring</source>
<date>Fri Apr 25 10:51:35 2008</date>
<type>執行演算法</type>
<content>Perform the operation of Partition on the array A = 〈10, 19, 9, 5, 12, 8, 7, 4, 11, 2, 6,13〉.</content>
<answer>algorithms_27216973.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>heap</about>
<about>heap sort</about>
<source>spring</source>
<date>Fri Apr 25 10:44:20 2008</date>
<type>執行演算法</type>
<content>請用 heap sort 的方式來將 〈13, 2, 3, 25, 7, 17, 8〉 作遞增排序
a)請用 max-heapify 將 heap 建出來。寫出調整每一個元素後的情形。
b)寫出建完 heap 後的排序過程，寫出搬走每個元素、調整完後的結果。</content>
<answer>algorithms_27216538.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<about>Master Theorem</about>
<source>spring</source>
<date>Fri Apr 25 10:40:57 2008</date>
<type>計算</type>
<content>Give asymptotic upper and lower bounds for T(n) in each of the following recurrences.
a. T(n) = 2T(n/4) + n1/2 
b. T(n) = T(n-1) + lg n
c. T(n) = 7T(n/2) + n2 
d. T(n) = T(n1/2) + 1	
e. T(n) = 4T(n/2) + n3
f. T(n) = T(n-1) + n</content>
<answer>algorithms_27216335.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<about>time complexity</about>
<source>spring</source>
<date>Fri Apr 25 10:39:20 2008</date>
<type>計算</type>
<content>Rank the following functions by order of growth; that is, find an arrangement g1, g2, ..., g15 of the functions satisfying g1 = O(g2), g2 = O(g3), ..., g14 = O(g15).
lg(lg*n), n2n, n!, (lg n)!, (3/2)n, lg2n, 22n, lg*n, 2nn, nlg lgn,(lg n)lg n, (n+1)!, lg*(lg n), 2n, 22n+1</content>
<answer>algorithms_27216238.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>heap</about>
<source>spring</source>
<date>Fri Apr 25 10:36:59 2008</date>
<type>設計演算法</type>
<content>6.5-8 Give an O(n lg k)-time algorithm to merge k sorted lists into one sorted list, where n is the total number of elements in all the input lists. (Hint: Use a min-heap for k-way merging.)</content>
<answer>algorithms_27216097.odp</answer>
<comment>習題6.5-8</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>selection sort</about>
<about>insertion sort</about>
<source>spring</source>
<date>Fri Apr 25 10:33:34 2008</date>
<type>執行演算法</type>
<content>請分別使用 selection sorting 、insertion sort的方式對 〈35, 32, 24, 33, 18, 11, 15〉作遞減排序；寫下每一個元素被排好後的情形。</content>
<answer>algorithms_27215892.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>time complexity</about>
<about>Big O</about>
<about>heap</about>
<about>sorting</about>
<source>spring</source>
<date>Fri Apr 25 10:31:26 2008</date>
<type>是非題</type>
<content>是非題
f(n) + g(n) = (min(f(n), g(n))).
f(n) = O(g(n)) ==> 2f(n) = O(2g(n)).
The height of a heap with 33 elements is 4.
The sequence 〈3, 7, 4, 6, 13, 10, 11, 15, 14, 16〉 is a min-heap.
Any comparison sort algorithm requires  Ω(n lg n) comparisons in the worst case.</content>
<answer>algorithms_27215764.odp</answer>
<comment>2008平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<about>Master Theorem</about>
<source>spring</source>
<date>Fri Apr 25 8:41:13 2008</date>
<type>計算</type>
<content>4.3-1 Use the master method to give tight asymptotic bounds for the following recurrences.
a. T(n) = 4T(n/2) + n.
b. T(n) = 4T(n/2) + n2.
c. T(n) = 4T(n/2) + n3.</content>
<answer>algorithms_27209151.odp</answer>
<comment>習題4.3-1</comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<about>Big O</about>
<about>Theta</about>
<about>Big Omega</about>
<source>spring</source>
<date>Fri Apr 25 8:39:17 2008</date>
<type>證明</type>
<content>Problem 3-4 Asymptotic notation properties
Let f(n) and g(n) be asymptotically positive functions. Prove or disprove each of the following conjectures.
a. f(n) = O(g(n)) implies g(n) = O(f(n)).
b. f(n) + g(n) = Θ(min(f(n), g(n))).
c. f(n) = O(g(n)) implies lg(f(n)) = O(lg(g(n))), where lg(g(n)) ≥ 1 and f(n) ≥ 1 for all sufficiently large n. 
d. f(n) = O(g(n)) implies 2f(n) = O(2g(n)).
e. f(n) = O((f(n))2).
f. f(n) = O(g(n)) implies g(n) = Ω(f(n))
g. f(n) = Θ(f(n/2))
h. f(n) + o(f(n)) = Θ(f(n)).</content>
<answer>algorithms_27209035.odp</answer>
<comment>習題 Problem 3-4</comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<source>spring</source>
<date>Fri Apr 25 8:35:05 2008</date>
<type>計算</type>
<content>Problem 3-3 Ordering by asymptotic growth rates</content>
<answer>algorithms_27208783.odp</answer>
<comment>習題 Problem 3-3</comment>
</record><record>
<course>algorithms</course>
<about>time complexity</about>
<source>spring</source>
<date>Fri Apr 25 8:31:19 2008</date>
<type>證明</type>
<content>3.1-7 Prove that o(g(n)) ∩ ω(g(n)) = Ø.</content>
<answer>algorithms_27208557.odp</answer>
<comment>習題3.1-7</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>time complexity</about>
<source>spring</source>
<date>Fri Apr 25 8:29:07 2008</date>
<type>設計演算法</type>
<content>2.3-7 Describe a (n lg n)-time algorithm that, given a set S of n integers and another integer x, determines whether or not there exist two elements in S whose sum is exactly x.</content>
<answer>algorithms_27208424.odp</answer>
<comment>習題2.3-7</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>selection sort</about>
<source>spring</source>
<date>Fri Apr 25 8:27:14 2008</date>
<type>設計演算法</type>
<content>2.2-2 Consider sorting n numbers sotred in array A by first finding the smallest element of A and exchanging it with the element in A[1]. Then find the second smallest element of A, and exchange it with A[2]. Continue in this manner for the first n-1 elements of A. Write pseudocode for this algorithm, which is known as selection sort. What loop invariant does this algorithm maintain? Why does it need to run for only the first n – 1 elements, rather than for all n elements? Give the best-case and worst case running times of selection sort in -notation.</content>
<answer>algorithms_27208312.odp</answer>
<comment>習題2.2-2</comment>
</record><record>
<course>algorithms</course>
<about>time complexity</about>
<about>merge sort</about>
<about>insertion sort</about>
<source>spring</source>
<date>Fri Apr 25 8:24:18 2008</date>
<type>計算</type>
<content>1.2-2 Suppose we are comparing implementations of insertion sort and merge sort on the same machine. For inputs of size n, insertion sort runs in 8n2 steps, while merge sort runs in 64 n log2n steps. For which values of n does insertion sort beat merge sort?</content>
<answer>algorithms_27208136.odp</answer>
<comment>習題1.2-2</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>spring</source>
<date>Fri Apr 25 8:18:21 2008</date>
<type>簡答</type>
<content>3.1.8 Give a simple verbal description of the language L((aa)*b(aa)* + a(aa)*ba(aa)*).</content>
<answer>formal languages_27207779.odp</answer>
<comment>習題3.1.8</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>李京釜</source>
<date>Fri Apr 25 6:34:57 2008</date>
<type>設計 regular expression</type>
<content>3.1.6 b) Give regular expressions for the language L2 ={anbm : n ＜ 4, m ≤ 3}.</content>
<answer>formal languages_27201575.odp</answer>
<comment>習題 3.1.6 b)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>spring</source>
<date>Fri Apr 25 6:31:50 2008</date>
<type>設計 regular expression</type>
<content>3.1.5 Find a regular expression for the set {anbm : (n + m) is even}.</content>
<answer>formal languages_27201388.odp</answer>
<comment>習題 3.1.5</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>spring</source>
<date>Fri Apr 25 6:26:38 2008</date>
<type>設計 regular expression</type>
<content>3.1.4 Find a regular expression for the set {anbm : n ≥ 3, m is even}.</content>
<answer>formal languages_27201076.odp</answer>
<comment>習題 3.1.4</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>spring</source>
<date>Fri Apr 25 6:12:59 2008</date>
<type>是非題</type>
<content>3.1. 20 Determine whether or not the following claims are true fro all regular expressions r1 and r2. The symbol ≡ stands for equivalence of regular expressions in the sense that both expressions denote the same language.
a). (r1*)* ≡ r1*
b). r1*(r1 + r2)* ≡ (r1 + r2)*
c). (r1 + r2)* ≡ (r1* r2*)*
d). (r1* r2*)* ≡ r1* r2*</content>
<answer>formal languages_27200257.odp</answer>
<comment>習題 3.1.20</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>spring</source>
<date>Fri Apr 25 6:02:13 2008</date>
<type>設計 regular expression</type>
<content>3.1.17 b) Write regular expressions for all strings not ending in 01 on Σ= {0, 1}.</content>
<answer>formal languages_27199611.odp</answer>
<comment>習題 3.1.17 b)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>吳 蕙 如</source>
<date>Thu Apr 24 14:49:00 2008</date>
<type>設計 regular expression</type>
<content>3.1.16 b) Give regular expression for the language with all strings containing no more than three a\'s on Σ = {a, b, c}.</content>
<answer>formal languages_27144818.odp</answer>
<comment>習題3.1.16 b)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>許鴻仁</source>
<date>Thu Apr 24 14:44:31 2008</date>
<type>設計 regular expression</type>
<content>3.1.16 d) Give regular expression for the language with all strings that contain no run of a\'s of length greater than two on Σ = {a, b, c}.</content>
<answer>formal languages_27144549.odp</answer>
<comment>習題3.1.16 d)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>劉驥雷</source>
<date>Thu Apr 24 14:41:15 2008</date>
<type>設計 regular expression</type>
<content>3.1.15 Find a regular expression for L = {w ∈ {0, 1}* : w has exactly one pair of consecutive zeros}</content>
<answer>formal languages_27144353.odp</answer>
<comment>習題3.1.15</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>spring</source>
<date>Thu Apr 24 14:36:02 2008</date>
<type>設計 regular expression</type>
<content>3.1.14 Find a regular expression for L = {vwv : v, w ∈ {a,b}*, |v| ≤ 3}</content>
<answer>formal languages_27144039.odp</answer>
<comment>習題3.1.14</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<source>spring</source>
<date>Thu Apr 24 14:07:00 2008</date>
<type>翻譯</type>
<content>請寫出下列英文的中文意義。 
We have defined regular languages, studied some ways in which they can be represented, and have seen a few examples of their usefulness. We now raise the question of how general regular languages are. Could it be that every formal language is regular? Perhaps any set can be accepted by some, albeit very complex, finite automaton. As we will see shortly, the answer to this conjecture is definitely no. But to understand why this is so, we must inquire more deeply into the nature of regular languages and see what properties the whole family has.</content>
<answer>formal languages_27142298.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>spring</source>
<date>Thu Apr 24 14:04:35 2008</date>
<type>設計 automaton</type>
<content>Construct a dfa that accepts strings on {0, 1} if and only if the value of the string, interpreted as a binary representation of an integer, is 2 modula 6.</content>
<answer>formal languages_27142153.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>right quotient</about>
<source>spring</source>
<date>Thu Apr 24 14:03:05 2008</date>
<type>設計 automaton</type>
<content>Let L1 = L(a*baa*) and L2 = L(aba*). Find L1/L2.</content>
<answer>formal languages_27142063.odp</answer>
<comment>習題4.1.10</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>NFA</about>
<source>spring</source>
<date>Thu Apr 24 14:00:51 2008</date>
<type>設計 automaton</type>
<content>Find an nfa that accepts the language L(ab*aa + bba*ab).</content>
<answer>formal languages_27141929.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<source>spring</source>
<date>Thu Apr 24 13:58:21 2008</date>
<type>證明</type>
<content>Show that if L is regular, so is LR.</content>
<answer>formal languages_27141778.odp</answer>
<comment>習題2.3.12</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>spring</source>
<date>Thu Apr 24 13:55:51 2008</date>
<type>設計 automaton</type>
<content>Construct a DFA to accept all strings on {0,1} that all strings of length three or more in which the second symbol from the right end is different from the leftmost symbol.</content>
<answer>formal languages_27141629.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<about>regular grammar</about>
<about>DFA</about>
<source>spring</source>
<date>Thu Apr 24 13:50:16 2008</date>
<type>設計</type>
<content>Find the dfa, regular grammar and regular expression for the language L = {w: (na(w) - nb(w)) mod 3 > 0} on ∑ = {a, b}.</content>
<answer>formal languages_27141294.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<about>regular grammar</about>
<about>DFA</about>
<source>spring</source>
<date>Thu Apr 24 13:44:54 2008</date>
<type>設計</type>
<content>Find  the dfa, regular expression and regular grammar for the language L = {w : |w| mod 3 ≠ |w| mod 2} on Σ = {a}.</content>
<answer>formal languages_27140972.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>spring</source>
<date>Thu Apr 24 6:08:41 2008</date>
<type>設計 regular expression</type>
<content>3.1.11 Find a regular expression for L = {abnw : n ≥ 3, w∈ {a, b}+}.</content>
<answer>formal languages_27113599.odp</answer>
<comment>習題3.1.11</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular grammars</about>
<about>right-linear grammars</about>
<source>涂毓城</source>
<date>Thu Apr 24 5:45:57 2008</date>
<type>設計 regular grammars</type>
<content>3.3.6 Construct a right-linear grammar for the language L((aab*ab)*).</content>
<answer>formal languages_27112235.odp</answer>
<comment>習題3.3.6</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>謝岦陞</source>
<date>Wed Apr 23 17:18:44 2008</date>
<type>設計 regular expression</type>
<content>3.1.18 b) Find regular expressions for L = {w :na(w) mod 3 = 0} on {a, b}.</content>
<answer>formal languages_27067402.odp</answer>
<comment>習題3.1.18 b)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>pumping lemma</about>
<source>陳柏緯</source>
<date>Wed Apr 23 17:04:18 2008</date>
<type>證明</type>
<content>4.3.9 Is the language L = {w ∈ {a, b, c}* : |w| = 3na(w)} regular ?</content>
<answer>formal languages_27066536.odp</answer>
<comment>習題4.3.9</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>張家銘</source>
<date>Wed Apr 23 16:57:44 2008</date>
<type>設計 automaton</type>
<content>3.2.7 Find the minimal dfa that accepts
 L(a*bb) ∪ L(ab*ba).</content>
<answer>formal languages_27066142.odp</answer>
<comment>習題3.2.7</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>楊良吉</source>
<date>Wed Apr 23 16:26:07 2008</date>
<type>設計 automaton</type>
<content>2.1.8 c) Find dfa\'s for the language {w: there are at most two runs of a\'s of length three} on {a, b}.</content>
<answer>formal languages_27064244.odp</answer>
<comment>習題2.1.8 c)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>朱致宏</source>
<date>Wed Apr 23 15:36:03 2008</date>
<type>設計 automaton</type>
<content>2.1.7 f) Find a dfa for the language L on Σ = {a, b}. L = {w: (na(w) + 2nb(w)) mod 3 ＜ 2}.</content>
<answer>formal languages_27061240.odp</answer>
<comment>習題2.1.7 f)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>吳威毅</source>
<date>Wed Apr 23 14:45:49 2008</date>
<type>設計 automaton</type>
<content>A2.10 Construct a DFA that accepts the language of binary strings in which every block of four symbols contains at least three 0’s.</content>
<answer>formal languages_27058227.odp</answer>
<comment>習題A2.10</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>胡偉諄</source>
<date>Wed Apr 23 14:33:19 2008</date>
<type>設計 regular expression</type>
<content>3.1.18 c) Find regular expressions for L = {w : na(w) mod 5 > 0} on {a, b}.</content>
<answer>formal languages_27057477.odp</answer>
<comment>習題3.1.18 c)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>陳羿亘</source>
<date>Wed Apr 23 12:47:05 2008</date>
<type>設計 automaton</type>
<content>3.2.5 b) Find a dfa that accept L(ab*a*) ∩ L((ab)*ba).</content>
<answer>formal languages_27051103.odp</answer>
<comment>習題3.2.5 b)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>NFA</about>
<source>張家銘</source>
<date>Wed Apr 23 12:32:18 2008</date>
<type>設計 automaton</type>
<content>A2.2 Construct an NFA that accepts the set of binary strings that contain both substrings010 and 101.
 [Hint: This is equivalent to the set of binary strings that contain either a substring 0101 or a substring 1010 or a substring 010 followed by 101 or a substring101 followed by 010.]</content>
<answer>formal languages_27050215.odp</answer>
<comment>習題A2.2</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>林祐誼</source>
<date>Wed Apr 23 9:58:01 2008</date>
<type>證明</type>
<content>2.1.11 Show that the language L = {vwv: v, w ∈ {a, b}*,  |v|  = 2} is regular.</content>
<answer>formal languages_27040959.odp</answer>
<comment>習題2.1.11</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular expression</about>
<source>賴映潔</source>
<date>Wed Apr 23 9:49:28 2008</date>
<type>設計 regular expression</type>
<content>3.1.16 (a) Give regular expression for the language with all strings containing exactly one a on Σ = {a, b, c}.</content>
<answer>formal languages_27040446.odp</answer>
<comment>習題3.1.16 a)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>黃弘碩</source>
<date>Wed Apr 23 9:45:21 2008</date>
<type>設計 automaton</type>
<content>2.1.9e) Construct a DFA to accept all strings on {0,1} that all strings of length five or more in which the fourth symbol from the right end is different from the leftmost symbol.</content>
<answer>formal languages_27040198.odp</answer>
<comment>習題2.1.9 e)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>regular grammars</about>
<about>left-linear grammar</about>
<source>蔡學仁</source>
<date>Wed Apr 23 9:40:15 2008</date>
<type>設計 grammars</type>
<content>3.3.10 Find a left-linear grammar for the language L((aab*ab)*).</content>
<answer>formal languages_27039893.odp</answer>
<comment>習題3.3.10</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>廖本宇</source>
<date>Wed Apr 23 9:21:43 2008</date>
<type>設計 automaton</type>
<content>2.1.5 c) Give a dfa for the language L = {w1abw2: w1∈ {a, b}*, w2 ∈ {a, b}*}.</content>
<answer>formal languages_27038780.odp</answer>
<comment>習題2.1.5 c)</comment>
</record><record>
<course>formal languages</course>
<about>sets</about>
<source>朱致宏</source>
<date>Wed Apr 23 9:14:58 2008</date>
<type>證明</type>
<content>1.1.9 Show that S1 ∪ S2 – (S1 ∩ S2) = S2.</content>
<answer>formal languages_27038376.odp</answer>
<comment>習題1.1.9</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>胡偉諄</source>
<date>Wed Apr 23 9:10:33 2008</date>
<type>設計 automaton</type>
<content>2.1.8 b   Find dfa\'s for the language 
{w: every run of a\'s has length either two or three} on {a, b}.</content>
<answer>formal languages_27038111.odp</answer>
<comment>習題2.1.8b)</comment>
</record><record>
<course>formal languages</course>
<about>mathematical induction</about>
<source>曾愷銘</source>
<date>Wed Apr 23 9:03:13 2008</date>
<type>證明</type>
<content>A.1-3 Prove by mathematical induction that 10n  + 3•4n + 5 is divisible by 9 for all natural numbers n.</content>
<answer>formal languages_27037671.odp</answer>
<comment>習題A1-3</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>謝棋安</source>
<date>Wed Apr 23 8:54:01 2008</date>
<type>設計 automaton</type>
<content>2.1.9 b) Construct a DFA to accept all strings on {0, 1} containing 00 but not 000.</content>
<answer>formal languages_27037119.odp</answer>
<comment>習題2.1.9b)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>謝岦陞</source>
<date>Wed Apr 23 8:44:11 2008</date>
<type>設計 automaton</type>
<content>2.1.7 b) Find a dfa for the language L on Σ = {a, b}. L = {w: |w| mod 5 ≠ 0}.</content>
<answer>formal languages_27036529.odp</answer>
<comment>習題2.1.7b)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>陳柏緯</source>
<date>Wed Apr 23 8:37:15 2008</date>
<type>設計 automaton</type>
<content>A2.9 Construct a DFA that accepts the language of strings over the alphabet {0,1,2} which are the ternary expansions (base-3 representations) of positive integers which are congruent to 2 modulo 7.</content>
<answer>formal languages_27036112.odp</answer>
<comment>習題A2.9</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>grammar</about>
<source>鄭翰鴻</source>
<date>Tue Apr 22 12:33:13 2008</date>
<type>設計 grammars</type>
<content>1.2.15(c) Find grammars for the language L = {w : |w| mod 3 ≠ |w| mod 2} on Σ = {a}.</content>
<answer>formal languages_26963871.odp</answer>
<comment>習題1.2.15(c)</comment>
</record><record>
<course>formal languages</course>
<about>sets</about>
<source>黃弘碩</source>
<date>Tue Apr 22 12:29:03 2008</date>
<type>證明</type>
<content>1.1.2 Show that if S1 and S2 are finite sets with |S1| = n and |S2| = m, then |S1 ∪ S2| ≤ n+m.</content>
<answer>formal languages_26963621.odp</answer>
<comment>習題1.1.2</comment>
</record><record>
<course>formal languages</course>
<about>Big O</about>
<about>Theta</about>
<source>廖本宇</source>
<date>Tue Apr 22 12:22:53 2008</date>
<type>證明</type>
<content>1.1.21 Show that if f(n) = (log2 n), then f(n) = (log10 n).</content>
<answer>formal languages_26963251.odp</answer>
<comment>習題1.1.21</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>蔡學仁</source>
<date>Tue Apr 22 12:13:34 2008</date>
<type>證明</type>
<content>2.1.15 Show that the language L = {an: n is a multiple of three, but not a multiple of 5} is regular.</content>
<answer>formal languages_26962692.odp</answer>
<comment>習題2.1.15</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>grammar</about>
<source>陳羿亘</source>
<date>Tue Apr 22 11:40:25 2008</date>
<type>設計 grammars</type>
<content>1.2.11-b. Find grammars for Σ = {a, b} that generate the sets of all strings with at least one a.</content>
<answer>formal languages_26960703.odp</answer>
<comment>習題1.2.11-b</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>陳羿亘</source>
<date>Tue Apr 22 11:35:13 2008</date>
<type>設計 automaton</type>
<content>2.1.7 e) Find a dfa for the language L on ∑ = {a, b}. L = {w: (na(w) – nb(w)) mod 3 > 0}.</content>
<answer>formal languages_26960391.odp</answer>
<comment>習題2.1.7 e)</comment>
</record><record>
<course>formal languages</course>
<about>relation</about>
<source>柯衍慶</source>
<date>Tue Apr 22 11:30:31 2008</date>
<type>找relation</type>
<content>A.1-2 Give an example of a relation that is symmetric and transitive but not reflexive.</content>
<answer>formal languages_26960109.odp</answer>
<comment>習題A1-2</comment>
</record><record>
<course>formal languages</course>
<about>rational number</about>
<source>謝岦陞</source>
<date>Tue Apr 22 11:26:31 2008</date>
<type>證明</type>
<content>1.1.31 Show that √3 is irrational.</content>
<answer>formal languages_26959869.odp</answer>
<comment>習題1.1.31</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>grammar</about>
<source>張家銘</source>
<date>Tue Apr 22 11:19:58 2008</date>
<type>設計 grammars</type>
<content>1.2.15(d) Find grammars for the language
 L = {w : |w| mod 3 ≥|w| mod 2} on Σ = {a}.</content>
<answer>formal languages_26959476.odp</answer>
<comment>習題1.2.15(d)</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>NFA</about>
<source>賴映潔</source>
<date>Tue Apr 22 11:12:04 2008</date>
<type>設計 automaton</type>
<content>2.2.10 a) Find an nfa with three states that accepts the language L = {an : n ≥ 1} ∪ { bmak : m ≥ 0, k ≥ 0}.
     b) Do you think the language in part a) can be accepted by an nfa with fewer than three states?</content>
<answer>formal languages_26959002.odp</answer>
<comment>習題2.2.10</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>NFA</about>
<source>鄭翰鴻</source>
<date>Tue Apr 22 11:06:53 2008</date>
<type>設計 automaton</type>
<content>A2.3 Construct an NFA that accepts the set of binary strings that contain either a substring 010 or a substring 101, and end with 111 or 000.</content>
<answer>formal languages_26958691.odp</answer>
<comment>習題A2.3</comment>
</record><record>
<course>formal languages</course>
<about>infinite number</about>
<source>賴映潔</source>
<date>Tue Apr 22 11:03:02 2008</date>
<type>證明</type>
<content>1.1.34 Prove that the set of all prime numbers is infinite.</content>
<answer>formal languages_26958460.odp</answer>
<comment>習題1.1.34</comment>
</record><record>
<course>formal languages</course>
<about>Big O</about>
<source>林祐誼</source>
<date>Tue Apr 22 10:54:25 2008</date>
<type>證明</type>
<content>1.1.18 Prove that if f(n) = O(g(n)) and g(n) = O(h(n)), then f(n) = O(h(n)).</content>
<answer>formal languages_26957943.odp</answer>
<comment>習題1.1.18</comment>
</record><record>
<course>formal languages</course>
<about>mathematical induction</about>
<source>林柏存</source>
<date>Tue Apr 22 10:48:50 2008</date>
<type>證明</type>
<content>A1-4Prove by mathematical induction that 10n  + 3•4n + 5 is divisible by 9 for all natural numbers n.</content>
<answer>formal languages_26957608.odp</answer>
<comment>習題A1.4</comment>
</record><record>
<course>formal languages</course>
<about>regular languages</about>
<about>DFA</about>
<source>洪喜音</source>
<date>Tue Apr 22 10:42:23 2008</date>
<type>設計 automaton</type>
<content>A2.8 Construct a DFA that accepts the language of strings over the alphabet {1,2,3} in which the sum of all symbols is divisible by 5.</content>
<answer>formal languages_26957221.odp</answer>
<comment>習題A2.8</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<source>胡偉諄</source>
<date>Tue Apr 22 10:38:50 2008</date>
<type>設計 grammars</type>
<content>1.2.14-c. Find a grammar that generates 
                 L3 =  {an+2bn: n ≥ 1}.</content>
<answer>formal languages_26957008.odp</answer>
<comment>習題1.2.14-c</comment>
</record><record>
<course>formal languages</course>
<about>mathematical induction</about>
<source>謝棋安</source>
<date>Tue Apr 22 10:34:07 2008</date>
<type>證明</type>
<content>A.1-5 Prove by mathematical induction that log72 + log714 + log798 +  . . .  + log7(2 * 7n )  =  1/2(n + 1)(n + log74). [Hint：  logdxn  = n * logdx]</content>
<answer>formal languages_26956725.odp</answer>
<comment>習題A.1-5</comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammars</about>
<source>spring</source>
<date>Tue Apr 22 8:39:48 2008</date>
<type>設計 grammars</type>
<content>1.2.14-g 之變形 Find a grammar that generates L33
L3 = {an+2 bn: n ³ 1}.</content>
<answer>formal languages_26949866.odp</answer>
<comment>習題1.2.14-g之變形</comment>
</record><record>
<course>formal languages</course>
<about>Big O</about>
<about>Theta</about>
<source>spring</source>
<date>Tue Apr 22 8:34:14 2008</date>
<type>證明</type>
<content>1.1.15 Show that if f(n) = O(g(n)) and g(n) = O(f(n)), then f(n) =  (g(n)).</content>
<answer>formal languages_26949532.odp</answer>
<comment>習題1.1.15</comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>linked list</about>
<source>spring</source>
<date>Tue Apr 22 8:14:59 2008</date>
<type>翻譯</type>
<content>請寫出下列英文的中文大意
A linked list is a data structure in which the objects are arranged in a linear order. Unlike an array, though, in which the linear order is determined by the array indices, the order in a linked list is determined by a pointer in each object. Linked lists provide a simple, flexible representation for dynamic sets.</content>
<answer>algorithms_26948377.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>algorithms</course>
<about>selection</about>
<about>randomized algorithms</about>
<source>spring</source>
<date>Tue Apr 22 8:02:25 2008</date>
<type>執行演算法</type>
<content>Suppose we use Randomized-Select to select the minimum element of the array A = 〈3, 2, 9, 0, 7, 5, 4, 8, 6, 1〉. Describe a sequence of partitions that results in a worst-case performance of Randomized-Select.</content>
<answer>algorithms_26947623.odp</answer>
<comment>習題 9.2-4</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>counting sort</about>
<about>stable</about>
<about>in place</about>
<source>spring</source>
<date>Tue Apr 22 7:58:00 2008</date>
<type>設計演算法</type>
<content>Suppose that we have an array of n data records to sort and that the key of each record has the value 0 or 1. An algorithm for sorting such a set of records might possess some subset of the following three desirable characteristics:
1. The algorithm runs in O(n) time.
2. The algorithm is stable.
3. The algorithm sorts in place.
a. Give an algorithm that satisfies criteria 1 and 2 above.
b. Give an algorithm that satisfies criteria 1 and 3 above.
c. Give an algorithm that satisfies criteria 2 and 3 above.</content>
<answer>algorithms_26947358.odp</answer>
<comment>習題 problem 8-2</comment>
</record><record>
<course>algorithms</course>
<about>time complexity</about>
<about>function</about>
<source>spring</source>
<date>Tue Apr 22 7:55:21 2008</date>
<type>證明</type>
<content>Let f(n) and g(n) be asymptotically positive functions. Prove or disprove each of the following conjectures.
a) f(n)=O(g(n)) implies g(n) = O(f(n)).
b) f(n)=O(g(n)) implies 2f(n) = O(2g(n)).
c) f(n) = Θ(f(n/2)).</content>
<answer>algorithms_26947199.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>algorithms</course>
<about>time complexity</about>
<about>recursive function</about>
<about>master theorem</about>
<source>spring</source>
<date>Tue Apr 22 7:53:26 2008</date>
<type>計算</type>
<content>Give asymptotic upper and lower bounds for T(n) in each of the following recurrences.
a. T(n) = T(n-1) + 1/n.
b. T(n) = T(n/2)+T(n/4)+T(n/8) + n.
c. T(n) = 5T(n/2) + n2.
d. T(n) = 27T(n/3) + n3.
e. T(n) = 2T(n-1) + 1.
f. T(n) = T(n/2) + n½.</content>
<answer>algorithms_26947084.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>algorithms</course>
<about>heap</about>
<about>priority queue</about>
<source>spring</source>
<date>Tue Apr 22 7:51:20 2008</date>
<type>執行演算法</type>
<content>Perform the operation of Max-Heap-Insert(A, 20) on the heap A = 〈15, 13, 9, 5, 12, 8, 7, 4, 0, 6, 2, 1〉.</content>
<answer>algorithms_26946958.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>algorithms</course>
<about>selection</about>
<about>sorting</about>
<source>spring</source>
<date>Tue Apr 22 7:47:56 2008</date>
<type>設計演算法</type>
<content>Suppose that you have a \"black-box\" worst-case linear-time median subroutine. Give a simple, linear-time algorithm that solves the selection problem for an arbitrary order statistic.</content>
<answer>algorithms_26946754.odp</answer>
<comment>習題9.3-5</comment>
</record><record>
<course>algorithms</course>
<about>sorting</about>
<about>selection</about>
<about>median</about>
<source>spring</source>
<date>Tue Apr 22 7:41:51 2008</date>
<type>分析演算法</type>
<content>Given a set of n numbers, we wish to find the i largest in sorted order using a comparison-based algorithm. Find the algorithm that implements each of the following methods with the best asymptotic worst-case running time, and analyze the running times of the algorithms in terms of n and i.
a. Sort the numbers, and list the i largest.
b. Build a max-priority queue from the numbers, and call Extract-Max i times.
c. Use an order-statistic algorithm fo find the ith largest number, partition around that number, and sort the i largest numbers.</content>
<answer>algorithms_26946389.odp</answer>
<comment>習題 problem 9-1</comment>
</record><record>
<course>algorithms</course>
<about>time complexity</about>
<about>data structure</about>
<about>sorting</about>
<source>spring</source>
<date>Tue Apr 22 7:38:00 2008</date>
<type>是非題</type>
<content>是非題
n0.001 + lg1000 n = (lg1000n).
1.001n + n1000 = O(n1000).
The time complexity of worst case of quicksort is (n lg n).
The time complexity of the best case of insertion sort is O(n).
A stack is the data structure based on the principle of “First In First Out”.</content>
<answer>algorithms_26946158.odp</answer>
<comment>2008期中考</comment>
</record><record>
<course>algorithms</course>
<about>all-pairs shortest paths</about>
<source>spring</source>
<date>Tue Dec 25 12:50:31 2007</date>
<type>翻譯</type>
<content>請寫出下列英文的中文大意
We can solve an all-pairs shortest-paths problem by running a single-source shortest-paths algorithm |V| times, once for each vertex as the source. If all edge weights are nonnegative, we can use Dijkstra\'s algorithm. If we use the linear-array implementation of the min-priority queue, the running time is O(V3+VE) = O(V3). The binary min-heap implementation of the min-priority queue yields a running time of O(VE lg V), which is an improvement if the graph is sparse. Alternatively, we can implement the min-priority queue with a Fibonacci heap, yielding a running time of O(V2 lg V + VE).</content>
<answer>algorithms_16683309.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>Dijkstra\'s algorithm</about>
<source>spring</source>
<date>Tue Dec 25 12:47:43 2007</date>
<type>證明</type>
<content>Suppose that we are given a weighted, directed graph G = (V, E) in which edges that leave the source vertex s may have negative weights, all other edge weights are nonnegative, and there are no negative-weight cycles. Argue that Dijkstra\'s algorithm correctly finds shortest paths from s in this graph.</content>
<answer>algorithms_16683141.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>tree</about>
<source>spring</source>
<date>Tue Dec 25 12:44:19 2007</date>
<type>設計演算法</type>
<content>The diameter of a tree T = (V, E) is given by 

  that is, the diameter is the largest of all shortest-path distances in the tree. Given an efficient algorithm to compute the diameter of a tree, and analyze the running time of your algorithm.</content>
<answer>algorithms_16682937.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>linear programming</about>
<source>spring</source>
<date>Tue Dec 25 12:42:16 2007</date>
<type>執行演算法</type>
<content>Find a feasible solution or determine that no feasible solution exists for the following system of difference constraints:
x1 – x2 ≤ 1, 	x1 – x4 ≤ -4,
x2 – x3 ≤ 2, 	x2 – x5 ≤ 7,
x2 – x6 ≤ 5, 	x3 – x6 ≤ 10,
x4 – x2 ≤ 2, 	x5 – x1 ≤ -1,
x5 – x4 ≤ 3, 	x6 – x3 ≤ -8。</content>
<answer>algorithms_16682814.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>Johnson\'s algorithm</about>
<source>spring</source>
<date>Tue Dec 25 12:38:09 2007</date>
<type>執行演算法</type>
<content>Use Johnson\'s algorithm to find the shortest paths between all pairs of vertices in the following graph. Show the values of h and w\' computed by the algorithm.</content>
<answer>algorithms_16682567.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>Floyd-Warshall</about>
<source>spring</source>
<date>Tue Dec 25 9:02:51 2007</date>
<type>執行演算法</type>
<content>Run the Floyd-Warshall algorithm on the following weighted, directed graph. Show the matrix D(k) that results for each iteration of the outer loop.</content>
<answer>algorithms_16669649.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>algorithms</course>
<about>disjoint sets</about>
<about>union and find</about>
<source>spring</source>
<date>Tue Dec 25 9:00:08 2007</date>
<type>執行演算法</type>
<content>0~12的數字，假設一開始每個數字都是一個集合，用union by rank與path compression作以下的運作，請畫出最後的結果。Union(0, 1), Union(2, 3), Union(6, 7), Union(0, 12), Union(8, 9), Union(10, 11), Union(0, 2), Union(8, 10), Union(0, 4), Union(4, 5), Find-set(6), Union(0, 8), Union(4, 6), Find-set(8)。</content>
<answer>algorithms_16669486.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>Bellman-Ford algorithm</about>
<source>spring</source>
<date>Tue Dec 25 8:58:41 2007</date>
<type>執行演算法</type>
<content>Run the Bellman-Ford algorithm on the following directed graph, using vertex z as the source.</content>
<answer>algorithms_16669399.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>tree traversal</about>
<source>spring</source>
<date>Mon Dec 24 19:42:05 2007</date>
<type>翻譯</type>
<content>請寫出下列英文的中文大意
Suppose we have the preorder sequence A B C D E F G H I and the inorder sequence B C A E D G H F I of the same binary tree. Does such a pair of sequences uniquely define a binary tree ? Put another way, can this pair of sequences come from more than one binary tree ?</content>
<answer>data structure_16621603.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>selection tree</about>
<about>winner tree</about>
<about>loser tree</about>
<source>spring</source>
<date>Mon Dec 24 19:40:54 2007</date>
<type>基本定義</type>
<content>用 8, 7, 6, 10, 5, 18, 7, 11 建一個 winner tree 與一個 loser tree.</content>
<answer>data structure_16621532.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>disjoint sets</about>
<about>union and find</about>
<source>spring</source>
<date>Mon Dec 24 19:39:11 2007</date>
<type>證明</type>
<content>假設一開始每棵 tree 都只有一個點，之後用 weighting rule 的方式作 union，若最後有一棵 tree T 的點數為 m，請證明 T 的高度不會超過 ⌊log2 m⌋ + 1。</content>
<answer>data structure_16621429.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>heap</about>
<source>spring</source>
<date>Mon Dec 24 19:37:40 2007</date>
<type>執行演算法</type>
<content>將下圖當做 max-heap，先刪掉最大值、再 insert 10, 畫出每次運算完成之後的heap.</content>
<answer>data structure_16621338.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>tree traversal</about>
<source>spring</source>
<date>Mon Dec 24 19:36:00 2007</date>
<type>執行演算法</type>
<content>Write down the preorder, inorder, postorder, and level-order traversal of the following binary tree.</content>
<answer>data structure_16621238.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>binary search tree</about>
<source>spring</source>
<date>Mon Dec 24 19:34:36 2007</date>
<type>執行演算法</type>
<content>在右圖這個 binary search tree中連續作下面的運算、畫出每個運算之後的結果。
a. insert 12, 
b. delete 3, 
c. delete 15, 
d. insert 13, 
e. delete 8。</content>
<answer>data structure_16621153.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>inorder sequence</about>
<about>preorder sequence</about>
<source>spring</source>
<date>Mon Dec 24 19:30:07 2007</date>
<type>執行演算法</type>
<content>令 binary tree T 的 inorder sequence 為 B D C E A F G I H J，而T 的 preorder sequence 為 A B C D E F G H I J，請畫出 T。</content>
<answer>data structure_16620885.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>generalized lists</about>
<source>spring</source>
<date>Mon Dec 24 19:28:43 2007</date>
<type>畫圖</type>
<content>請用 generalized list 的方式畫出多項式 3x2y6z2 + 8x3y5z3 + 2x4y2z3 + 4x4y6z2 + 6xy2z3 的 list。</content>
<answer>data structure_16620801.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<source>spring</source>
<date>Mon Dec 24 19:26:59 2007</date>
<type>計算</type>
<content>請問5個點的binary tree 有幾個、6個點的binary tree 又有幾個呢？</content>
<answer>data structure_16620697.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>polynomial</about>
<source>spring</source>
<date>Mon Dec 24 19:25:50 2007</date>
<type>畫圖</type>
<content>畫出下列多項式相加之後的結果。</content>
<answer>data structure_16620628.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>tree</about>
<source>spring</source>
<date>Mon Dec 24 19:24:36 2007</date>
<type>是非題</type>
<content>是非題
a)complete binary tree中不可能有degree為1的點。
b)要將binary tree每個點都拜訪過一次一定要使用 stack 才行。
c)每個 tree 的點數至少為 1。
d)每個 binary tree的點數至少為1。
e)點數至少為1的binary tree都一定有左子樹和右子樹。
f)在 heap 中作 insert 與刪掉最大值的時間都與 heap 的高度成正比。
g)在binary search tree中每個點的值都不能相同。
h)要將k個已經排序好的數列merge成一個排序好的數列，worst case一定要在 (nk)的時間複雜度才作得到，其中n是k個數列的元素個數總合。
i)10個點的 binary tree，其高度至少是5，最多是10。
j)存在兩個 binary trees T1 與 T2，它們的 inorder sequence相同、level-order sequence 也相同。</content>
<answer>data structure_16620554.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<source>spring</source>
<date>Mon Dec 24 19:19:42 2007</date>
<type>翻譯</type>
<content>請寫出下列英文的中文大意
Binary trees are an important type of tree structure that occurs very often. Binary trees are characterized by the fact that any node can have at most two branches (i.e., there is no node with degree greater than two). For binary trees we distinguish between the subtree on the left and that on the right, whereas for trees the order of the subtrees is irrelevant. Also, a binary tree may have zero nodes. Thus, a binary tree is really a different object from a tree.</content>
<answer>data structure_16620260.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>selection tree</about>
<about>winner tree</about>
<about>loser tree</about>
<source>spring</source>
<date>Mon Dec 24 19:18:35 2007</date>
<type>基本定義</type>
<content>用 3, 9, 6, 16, 5, 8, 7, 11 建一個 winner tree 與一個 loser tree.</content>
<answer>data structure_16620193.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>disjoint sets</about>
<about>union and find</about>
<source>spring</source>
<date>Mon Dec 24 19:16:51 2007</date>
<type>執行演算法</type>
<content>假設0~12 共13個元素，一開始每個元素都是一個集合,使用 weighting rule 與 collapsing rule，做下列的運算，畫出最後的結果。 union(0, 1), union(0,2), union(3,4), union(5, 6), union(7, 8), union(0, 3), union(11, 0), Find(4), union(10, 12), union(5, 7), union(10, 0), union(0, 5), Find(8) 。</content>
<answer>data structure_16620089.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>heap</about>
<source>spring</source>
<date>Mon Dec 24 19:14:40 2007</date>
<type>執行演算法</type>
<content>將第7題的圖當做 max-heap，先刪掉最大值、再 insert 18, 畫出每次運算完成之後的heap.</content>
<answer>data structure_16619958.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>tree traversal</about>
<source>spring</source>
<date>Mon Dec 24 19:12:53 2007</date>
<type>執行演算法</type>
<content>Write down the preorder, inorder, postorder, and level-order traversal of the following binary tree.</content>
<answer>data structure_16619851.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>tree</about>
<about>binary tree</about>
<about>binary search tree</about>
<source>spring</source>
<date>Mon Dec 24 19:09:21 2007</date>
<type>執行演算法</type>
<content>在右圖這個 binary search tree中連續作下面的運算、畫出每個運算之後的結果。
a. insert 6, 
b. delete 3, 
c. delete 4, 
d. insert 12, 
e. delete 11。</content>
<answer>data structure_16619639.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>tree</about>
<about>binary tree</about>
<source>spring</source>
<date>Mon Dec 24 19:07:23 2007</date>
<type>證明</type>
<content>Prove the following statement.  For any nonempty binary tree, T, if n0 is the number of leaf nodes and n2 the number of nodes of degree 2, then n0 = n2 + 1.</content>
<answer>data structure_16619521.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>generalized lists</about>
<source>spring</source>
<date>Mon Dec 24 19:05:48 2007</date>
<type>畫圖</type>
<content>請用 generalized list 的方式畫出多項式 3x2y8z2 + 3x3y5z2 + 2x4y2z + 3x4y5z2 + 2xy2z 的 list。</content>
<answer>data structure_16619426.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>disjoint sets</about>
<about>union and find</about>
<source>spring</source>
<date>Mon Dec 24 19:03:56 2007</date>
<type>執行演算法</type>
<content>令S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, pairs of equivalence relation: 0 ≡ 1, 4 ≡ 13, 3 ≡ 9, 1 ≡ 10, 11 ≡ 12, 4 ≡ 5, 2 ≡ 8, 0 ≡ 9, 1 ≡ 11, 7 ≡ 10, 2 ≡ 5, 請輸出其 equivalence class 。</content>
<answer>data structure_16619314.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>linked list</about>
<source>spring</source>
<date>Wed Dec 19 19:31:14 2007</date>
<type>執行演算法</type>
<content>畫出下列多項式相加之後的結果。</content>
<answer>data structure_16188952.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>tree</about>
<source>spring</source>
<date>Wed Dec 19 19:28:31 2007</date>
<type>是非題</type>
<content>是非題
a. complete binary tree中不可能有degree為1的點。
b. 要將binary tree每個點都拜訪過一次一定要使用 stack 才行。
c. 點數為10的tree每個點都用4個指標指向children，共有31個指標指向0。
d. 每個 binary tree的點數至少為1。
e. 點數至少為1的binary tree都一定有左子樹和右子樹。
f. 在 heap 中作 insert 與刪掉最大值的時間都與 heap 的高度成正比。
g. 在binary search tree中每個點的值都不能相同。
h. 要將k個已經排序好的數列merge成一個排序好的數列，worst case一定要在 (nk)的時間複雜度才作得到，其中n是k個數列的元素個數總合。
i. 20個點的 binary tree，其高度至少是5，最多是15。
j. 在equivalence classes的問題中，若有m個元素與n個相等的pairs，其演算法的時間複雜度為 (mn)。</content>
<answer>data structure_16188789.odp</answer>
<comment>2007平常測驗二</comment>
</record><record>
<course>data structure</course>
<about>tree traversal</about>
<about>inorder</about>
<about>preorder</about>
<about>level-order</about>
<source>spring</source>
<date>Fri Dec 14 9:00:56 2007</date>
<type>執行演算法</type>
<content>Write down the preorder, inorder, postorder, and level-order traversal of the binary tree.</content>
<answer>data structure_15719134.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>heap</about>
<source>spring</source>
<date>Fri Dec 14 8:57:59 2007</date>
<type>執行演算法</type>
<content>將下面的 complete binary tree 當做 max-heap，先 insert 23、再刪掉最大值，畫出每次運算之後的 heap。</content>
<answer>data structure_15718957.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary search tree</about>
<about>binary tree</about>
<source>spring</source>
<date>Fri Dec 14 8:52:34 2007</date>
<type>執行演算法</type>
<content>在下圖這個 binary search tree中連續作下面的運算、畫出每個運算之後的結果。a. insert 7, b. delete 14, c. delete 4, d. delete 8。</content>
<answer>data structure_15718631.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>selection tree</about>
<about>winner tree</about>
<about>loser tree</about>
<source>spring</source>
<date>Fri Dec 14 8:51:10 2007</date>
<type>基本定義</type>
<content>用 8, 9, 6, 12, 5, 13, 7, 11 建一個 winner tree 與一個 loser tree.</content>
<answer>data structure_15718548.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>disjoint sets</about>
<about>union and find</about>
<source>spring</source>
<date>Thu Dec 13 20:34:19 2007</date>
<type>執行演算法</type>
<content>假設0~8 共9個元素，一開始每個元素都是一個集合，使用 weighting rule 與 collapsing rule，做下列的運算，畫出最後的結果。union(0,1) ,union(0, 2), union(3,4), union(5, 6), union(7,8), union(0, 3), Find(4), union(5,7), union(0, 5), Find(8)。</content>
<answer>data structure_15674337.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>heap</about>
<source>spring</source>
<date>Thu Dec 13 20:11:35 2007</date>
<type>執行演算法</type>
<content>在下面的 max heap 中連續作下列兩個運算、並畫出每個運算後的結果。
i. delete maximum
ii. insert 18</content>
<answer>data structure_15672973.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>selection tree</about>
<about>winner tree</about>
<about>loser tree</about>
<source>spring</source>
<date>Thu Dec 13 19:59:49 2007</date>
<type>基本定義</type>
<content>用 10, 9, 6, 12, 5, 13, 7, 11 建一個 winner tree 與一個 loser tree.</content>
<answer>data structure_15672267.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary search tree</about>
<about>binary tree</about>
<source>spring</source>
<date>Thu Dec 13 19:55:17 2007</date>
<type>執行演算法</type>
<content>在下圖這個 binary search tree中連續作下面的運算、畫出每個運算之後的結果。a. insert 6, b. delete 10, c. delete 11, d. delete 9。</content>
<answer>data structure_15671995.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>algorithms</course>
<about>topological sort</about>
<about>directed acyclic graphs</about>
<about>depth-first search</about>
<about>習題22.4-1</about>
<source>spring</source>
<date>Wed Nov 21 6:36:33 2007</date>
<type>執行演算法</type>
<content>Show the ordering of vertices produced by TOPOLOGICAL-SORT when it is run on the following dag.</content>
<answer>algorithms_13723271.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>英文翻譯</about>
<source>spring</source>
<date>Wed Nov 21 6:11:41 2007</date>
<type>翻譯</type>
<content>請寫出下列英文的中文大意
What are the virtues of postfix notation that enable easy evaluation of expressions? To begin with, the need for parentheses is eliminated. Second, the priority of the operators is no longer relevant. The expression may be evaluated by making a left to right scan, stacking operands, and evaluating operators using as operands the correct number from the stack and finally placing the result onto the stack. This evaluation process is much simpler than attempting direct evaluation from infix notation.</content>
<answer>data structure_13721779.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>linked list</about>
<source>spring</source>
<date>Wed Nov 21 6:08:45 2007</date>
<type>基本性質</type>
<content>a).請畫出右表的 linked list, 假設第一個元素在第 8 個位置。
b).若要將 CAT 從 linked list 中刪掉，請問表中的資料要如何修改？</content>
<answer>data structure_13721603.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>postfix</about>
<about>prefix</about>
<source>spring</source>
<date>Wed Nov 21 6:03:00 2007</date>
<type>計算</type>
<content>Compute the value of the following expressions.
a). Postfix: 7 8 2 – 6 3 / * +  
b). Prefix:  / + * 6 – 7 4 8 2</content>
<answer>data structure_13721258.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>infix</about>
<about>prefix</about>
<about>postfix</about>
<source>spring</source>
<date>Wed Nov 21 6:00:39 2007</date>
<type>計算</type>
<content>Write the postfix form and prefix form of the following expressions (照C++的優先順序)</content>
<answer>data structure_13721117.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>maze</about>
<source>spring</source>
<date>Wed Nov 21 5:57:08 2007</date>
<type>maze 設計</type>
<content>請設計一個 6 × 7 的迷宮，以課本的演算法來執行時，所找到的路徑愈長愈好。</content>
<answer>data structure_13720906.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>maze</about>
<source>spring</source>
<date>Wed Nov 21 5:51:27 2007</date>
<type>執行演算法</type>
<content>下面 7× 8 的迷宮用課本老鼠走迷宮的演算法來走，請畫出所走出來的路徑。左上方為入口、右下方為出口。</content>
<answer>data structure_13720565.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>interconnection networks</course>
<about>Kautz network</about>
<about>internally disjoint paths</about>
<about>routing</about>
<source>spring</source>
<date>Tue Nov 20 17:24:18 2007</date>
<type>基本性質</type>
<content>請畫出 Kautz network B(6, 5) 裡面從 63154 到 54542 之間的六條 internally disjoint paths。</content>
<answer>interconnection networks_13675736.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>failure function</about>
<source>spring</source>
<date>Tue Nov 20 12:24:23 2007</date>
<type>計算</type>
<content>以下列 failure function 的定義，計算下面兩個字串的 failure functions。
a) xyzyxyzyxxyz;
b) aabbcaabaaba;</content>
<answer>data structure_13657741.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>time complexity</about>
<source>spring</source>
<date>Tue Nov 20 12:22:44 2007</date>
<type>證明</type>
<content>Prove or disprove the following equalities. 
a. n4 + 200n3 = (n4)
b. 2n3 + 5n2 = O(n2)</content>
<answer>data structure_13657642.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>hanoi tower</about>
<about>recursive</about>
<about>programming</about>
<source>spring</source>
<date>Tue Nov 20 12:16:39 2007</date>
<type>執行程式</type>
<content>用  H(3, \'X\', \'Y\', \'Z\') 呼叫下列 C++ 的函式，其執行結果為何？</content>
<answer>data structure_13657277.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>time complexity</about>
<about>infix form</about>
<about>postfix form</about>
<about>queue</about>
<source>spring</source>
<date>Tue Nov 20 12:14:08 2007</date>
<type>是非題</type>
<content>是非題
a).32n + 23n = (23n)
b).n2.0001 + n2 log2 n = (n2 log2 n)
c).KMP algorithm為作 string pattern matching 的演算法，其時間複雜度為 Q(LengthP * LengthS)，LengthP與LengthS為兩個字串的長度。
d).將 infix 轉成postfix的表示方式，其演算法為 (n)，n 是運算式的 token 數。
e).Queue 是 Last-In-First-Out、stack 是 First-In-First-Out 的資料結構。</content>
<answer>data structure_13657126.odp</answer>
<comment>2007期中考題</comment>
</record><record>
<course>data structure</course>
<about>stack</about>
<about>postfix form</about>
<source>spring</source>
<date>Tue Nov 6 8:42:14 2007</date>
<type>計算</type>
<content>計算 6  3  2 +  * 2  /  5 – 的值。</content>
<answer>data structure_12434812.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>stack</about>
<about>infix form</about>
<about>postfix form</about>
<about>prefix form</about>
<source>spring</source>
<date>Tue Nov 6 8:40:51 2007</date>
<type>計算</type>
<content>將 (A + B) * (C + E) / (F + A) * (D + C)  轉成 postfix 與 prefix 形式 。</content>
<answer>data structure_12434729.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>stack</about>
<about>postfix form</about>
<source>spring</source>
<date>Tue Nov 6 8:39:04 2007</date>
<type>計算</type>
<content>計算 6  3  2 –  * 2  /  5 + 的值。</content>
<answer>data structure_12434622.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>stack</about>
<about>infix form</about>
<about>postfix form</about>
<source>spring</source>
<date>Tue Nov 6 8:37:47 2007</date>
<type>計算</type>
<content>將 A + (B * C + E) / (F + A) * D + C  轉成 postfix 。</content>
<answer>data structure_12434545.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>algorithms</course>
<about>graphs</about>
<about>depth-first search</about>
<source>spring</source>
<date>Mon Nov 5 18:03:32 2007</date>
<type>給反例</type>
<content>Give a counterexample to the conjecture that if there is a path from u to v in a directed graph G, and if d[u] ≤ d[v] in a depth-first search of G, then v is a descendant of u in the depth-first forest produced.</content>
<answer>algorithms_12382090.odp</answer>
<comment>習題22.3-7</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>directed acyclic graph</about>
<source>spring</source>
<date>Mon Nov 5 17:58:56 2007</date>
<type>設計演算法</type>
<content>Give an efficient algorithm to count the total number of paths in a directed acyclic graph. Analyze your algorithm.</content>
<answer>algorithms_12381813.odp</answer>
<comment>習題24.2-4</comment>
</record><record>
<course>algorithms</course>
<about>all-pairs shortest paths</about>
<about>Johnson\'s algorithm</about>
<source>spring</source>
<date>Mon Nov 5 17:56:04 2007</date>
<type>基本性質</type>
<content>Suppose that w(u, v) ≥ 0 for all edges (u, v) ∈ E. What is the relationship between the weight functions w and w\'?</content>
<answer>algorithms_12381642.odp</answer>
<comment>習題25.3-3</comment>
</record><record>
<course>algorithms</course>
<about>all-pairs shortest paths</about>
<about>transitive closure</about>
<source>spring</source>
<date>Mon Nov 5 17:54:00 2007</date>
<type>設計演算法</type>
<content>Give an O(VE)-time algorithm for computing the transitive closure of a directed graph G(V, E).</content>
<answer>algorithms_12381518.odp</answer>
<comment>習題25.2-8</comment>
</record><record>
<course>algorithms</course>
<about>all-pairs shortest paths</about>
<about>negative-weight cycle</about>
<source>spring</source>
<date>Mon Nov 5 17:52:06 2007</date>
<type>修改演算法</type>
<content>Modify FASTER-ALL-PAIRS-SHORTEST-PATHS so that it can detect the presence of a negative-weight cycle.</content>
<answer>algorithms_12381404.odp</answer>
<comment>習題25.1-9</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>Bellman-Ford algorithm</about>
<about>negative-weight cycle</about>
<source>spring</source>
<date>Mon Nov 5 17:49:14 2007</date>
<type>證明</type>
<content>Let G = (V, E) be a weighted, directed graph with source vertex s, and let G be initialized by INITIALIZE-SINGLE-SOURCE(G, s). Prove that if a sequence of relaxation steps sets  π[s] to a non-NIL value, then G contains a negative-weight cycle.</content>
<answer>algorithms_12381232.odp</answer>
<comment>習題24.5-4</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>linear programming</about>
<source>spring</source>
<date>Mon Nov 5 17:46:48 2007</date>
<type>執行演算法</type>
<content>Find a feasible solution or determine that no feasible solution exists for the following system of difference constraints:
x1 – x2 ≤ 4, x1 – x5 ≤ 5,
x2 – x4 ≤ -6, 	x3 – x2 ≤ 1,
x4 – x1 ≤ 3, 	x4 – x3 ≤ 5,
x4 – x5 ≤ 10, x5 – x3 ≤ -4,
x5 – x4 ≤ -8.</content>
<answer>algorithms_12381086.odp</answer>
<comment>習題24.4-2</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>Dijkstra\'s algorithm</about>
<source>spring</source>
<date>Mon Nov 5 17:45:16 2007</date>
<type>給反例</type>
<content>Give a simple example of a directed graph with negative-weight edges for which Dijkstra\'s algorithm produces incorrect answers. Why doesn\'t the proof of Theorem 24.6 go through when negative-weight edges are allowed?</content>
<answer>algorithms_12380994.odp</answer>
<comment>習題24.3-2</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>Bellman-Ford algorithm</about>
<source>spring</source>
<date>Mon Nov 5 17:41:06 2007</date>
<type>執行演算法</type>
<content>Modify the Bellman-Ford algorithm so that it sets d[v] to -∞ for all vertices v for which there is a negative-weight cycle on some path from the source to v.</content>
<answer>algorithms_12380744.odp</answer>
<comment>習題24.1-4</comment>
</record><record>
<course>algorithms</course>
<about>minimum cost spanning tree</about>
<about>Kruskal\'s algorithm</about>
<source>spring</source>
<date>Mon Nov 5 17:30:45 2007</date>
<type>分析演算法</type>
<content>Suppose that all edge weights in a graph are integers in the range from 1 to |V|. How fast can you make Kruskal\'s algorithm run? What if the edge weights are integers in the range from 1 to W for some constant W?</content>
<answer>algorithms_12380123.odp</answer>
<comment>習題23.2-4</comment>
</record><record>
<course>algorithms</course>
<about>minimum cost spanning tree</about>
<about>light edge</about>
<source>spring</source>
<date>Mon Nov 5 17:26:44 2007</date>
<type>證明</type>
<content>Show that a graph has a unique minimum spanning tree if, for every cut of the graph, there is a unique light edge crossing the cut. Show that the converse is not true by giving a counterexample.</content>
<answer>algorithms_12379882.odp</answer>
<comment>習題23.1-6</comment>
</record><record>
<course>algorithms</course>
<about>graphs</about>
<about>strongly connected components</about>
<about>directed graph</about>
<source>spring</source>
<date>Mon Nov 5 17:19:35 2007</date>
<type>基本性質</type>
<content>How can the number of strongly connected components of a graph change if a new edge is added?</content>
<answer>algorithms_12379453.odp</answer>
<comment>習題22.5-1</comment>
</record><record>
<course>algorithms</course>
<about>graphs</about>
<about>depth-first search</about>
<about>cycle</about>
<source>spring</source>
<date>Mon Nov 5 17:16:58 2007</date>
<type>設計演算法</type>
<content>Give an algorithm that determines whether or not a given undirected graph G = (V, E) contains a cycle. Your algorithm should run in O(V) time, independent of |E|.</content>
<answer>algorithms_12379296.odp</answer>
<comment>習題22.4-3</comment>
</record><record>
<course>algorithms</course>
<about>graphs</about>
<about>breadth-first search</about>
<source>spring</source>
<date>Mon Nov 5 17:10:56 2007</date>
<type>執行演算法</type>
<content>Show the d and π values that result from running breadth-first search on the directed graph of Figure 22.2(a), using vertex 3 as the source.</content>
<answer>algorithms_12378934.odp</answer>
<comment>習題22.2-1</comment>
</record><record>
<course>algorithms</course>
<about>disjoint sets</about>
<about>union and find</about>
<source>spring</source>
<date>Mon Nov 5 17:09:01 2007</date>
<type>證明</type>
<content>Professor Dante reasons that because node ranks increase strictly along a path to the root, node levels must monotonically increase along the path. In other words, if rank(x) > 0 and p[x] is not a root, then level(x) ≤ level(p[x]). Is the professor correct?</content>
<answer>algorithms_12378819.odp</answer>
<comment>習題21.4-5</comment>
</record><record>
<course>algorithms</course>
<about>disjoint sets</about>
<about>union and find</about>
<source>spring</source>
<date>Mon Nov 5 17:07:14 2007</date>
<type>設計演算法</type>
<content>Suggest a simple change to the Union procedure for the linked-list representation that removes the need to keep the tail pointer to the last object in each list. Whether or not the weighted-union heuristic is used, your change should not change the asymptotic running time of the Union procedure. (Hint: Rather than appending one list to another, splice them together.)</content>
<answer>algorithms_12378712.odp</answer>
<comment>習題21.2-5</comment>
</record><record>
<course>data structure</course>
<about>mazing problem</about>
<source>spring</source>
<date>Fri Oct 26 15:17:21 2007</date>
<type>設計迷宮</type>
<content>請設計一個 4 × 5 的迷宮，以課本的演算法來執行時，所找到的路徑愈長愈好。</content>
<answer>data structure_11508119.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>mazing problem</about>
<source>spring</source>
<date>Fri Oct 26 15:13:53 2007</date>
<type>執行演算法</type>
<content>下面 6 × 8 的迷宮用課本老鼠走迷宮的演算法來走，請畫出所走出來的路徑。左上方為入口、右下方為出口。</content>
<answer>data structure_11507911.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>interconnection networks</course>
<about>diameter</about>
<about>Hamiltonian</about>
<about>Cartesian product</about>
<source>spring</source>
<date>Fri Oct 26 15:10:39 2007</date>
<type>畫圖</type>
<content>關於下列圖形 (a) 請問其 diameter 為何？ (b) 請畫出一個 Hamiltonian cycle 。</content>
<answer>interconnection networks_11507717.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>mazing problem</about>
<source>spring</source>
<date>Thu Oct 25 14:48:21 2007</date>
<type>執行演算法</type>
<content>下面 6 × 7 的迷宮用課本老鼠走迷宮的演算法來走，請畫出所走出來的路徑。左上方為入口、右下方為出口。</content>
<answer>data structure_11419979.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>英文翻譯</about>
<source>spring</source>
<date>Wed Oct 24 15:09:47 2007</date>
<type>翻譯</type>
<content>請寫出下列英文的中文大意。
The concept of an algorithm is fundamental to computer science. Algorithms exist for many common problems, and designing efficient algorithms plays a crucial role in developing large-scale computer systems. Therefore, before we proceed further, we discuss this concept more fully.</content>
<answer>data structure_11334865.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>failure function</about>
<source>spring</source>
<date>Wed Oct 24 15:08:40 2007</date>
<type>計算</type>
<content>若 failure function 改成下列定義，上面兩個字串的 failure functions 的值會是多少？
a) zzyxzzxzzyxz;
b) ccababccabac;</content>
<answer>data structure_11334798.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>failure function</about>
<source>spring</source>
<date>Wed Oct 24 15:07:28 2007</date>
<type>計算</type>
<content>以下列 failure function 的定義，計算下面兩個字串的 failure functions。
a) zzyxzzxzzyxz;
b) ccababccabac;</content>
<answer>data structure_11334725.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>array</about>
<about>array representation</about>
<source>spring</source>
<date>Wed Oct 24 15:06:27 2007</date>
<type>計算</type>
<content>How many values can be held by the array A[3][4][3][2] in C++ ?Assume that the address of A[0][0][0][0][0] is 1000 and every element is one byte. What is the address of  A[1][1][2][0] ?</content>
<answer>data structure_11334665.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>time complexity</about>
<about>Big O</about>
<about>Theta</about>
<source>spring</source>
<date>Wed Oct 24 15:05:24 2007</date>
<type>證明</type>
<content>Prove or disprove the following equalities. 
a. n3 + 106n2 = (n3)   b. 33n3 + 4n2 = O(n2)</content>
<answer>data structure_11334602.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>recursive function</about>
<about>Ackermann\'s function</about>
<source>spring</source>
<date>Wed Oct 24 15:01:16 2007</date>
<type>程式設計</type>
<content>Write a C++ recursive function for the following function.</content>
<answer>data structure_11334354.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>array</about>
<about>matrix transpose</about>
<about>fast transpose</about>
<source>spring</source>
<date>Wed Oct 24 14:59:52 2007</date>
<type>計算</type>
<content>Write the transpose of the following 65 sparse matrix using the FastTranspose algorithm. You must also write down the two arrays RowSize and RowStart.</content>
<answer>data structure_11334270.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>recursive function</about>
<about>Hanoi Tower</about>
<source>spring</source>
<date>Wed Oct 24 14:58:12 2007</date>
<type>程式設計</type>
<content>寫下搬動河內塔(Hanoi tower)的遞迴函式，令三個塔分別是\'A\', \'B\', \'C\'，若剛開始的 8 個圓盤都放在 \'C\'，最後要搬到 \'B\'，寫下呼叫您函式的方法。</content>
<answer>data structure_11334170.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>time complexity</about>
<about>Theta</about>
<source>spring</source>
<date>Wed Oct 24 14:56:58 2007</date>
<type>計算</type>
<content>What is the time complexity of the following algorithm? 以與 n 來表示。</content>
<answer>data structure_11334096.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>recursive function</about>
<source>spring</source>
<date>Wed Oct 24 14:55:24 2007</date>
<type>簡答</type>
<content>請描述下列函式 f 的功能</content>
<answer>data structure_11334002.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>time complexity</about>
<about>Big O</about>
<about>Omega</about>
<about>Theta</about>
<source>spring</source>
<date>Wed Oct 24 14:53:54 2007</date>
<type>是非題</type>
<content>是非題</content>
<answer>data structure_11333912.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>英文翻譯</about>
<source>spring</source>
<date>Wed Oct 24 14:49:58 2007</date>
<type>翻譯</type>
<content>請寫出下列英文的中文大意
Assume that we have two strings, s and pat, where pat is a pattern to be searched for in s. We will determine if pat is in s by using the function Find. The invocation s.Find(pat) returns an index i such that pat matches the substring of s that begins at position i. It returns -1 if and only if pat is either empty or is not a substring of s. Let us examine how a function Find may be implemented.</content>
<answer>data structure_11333676.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>failure function</about>
<source>spring</source>
<date>Wed Oct 24 14:48:26 2007</date>
<type>計算</type>
<content>若 failure function 改成下列定義，下面兩個字串的 failure functions 的值會是多少？
a) abcaabcab;
b) bacbabcba;</content>
<answer>data structure_11333584.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>failure function</about>
<source>spring</source>
<date>Wed Oct 24 14:44:52 2007</date>
<type>計算</type>
<content>以下列 failure function 的定義，計算下面兩個字串的 failure functions。
a) abcaabcab;
b) bacbabcba;</content>
<answer>data structure_11333370.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>array</about>
<about>row major</about>
<source>spring</source>
<date>Wed Oct 24 14:42:53 2007</date>
<type>計算</type>
<content>How many values can be held by the array A[2][4][3][2][4] in C++ ?Assume that the address of A[0][0][0][0][0] is 10000 and every element is one byte. What is the address of  A[1][3][0][1][2] ?</content>
<answer>data structure_11333251.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>array</about>
<about>matrix transpose</about>
<about>fast transpose</about>
<source>spring</source>
<date>Wed Oct 24 14:41:18 2007</date>
<type>執行演算法</type>
<content>Write the transpose of the following 6x5 sparse matrix using the FastTranspose algorithm. You must also write down the two arrays RowSize and RowStart.</content>
<answer>data structure_11333156.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>time complexity</about>
<about>Big O</about>
<about>Theta</about>
<source>spring</source>
<date>Wed Oct 24 14:39:25 2007</date>
<type>證明</type>
<content>Prove or disprove the following equalities. 
a. 20n2 + 4n = (n2)   b. 2n3 + 5n = O(n2)</content>
<answer>data structure_11333043.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>recursive function</about>
<about>selection</about>
<source>spring</source>
<date>Wed Oct 24 14:36:23 2007</date>
<type>程式設計</type>
<content>Write a C++ recursive function for the following function.</content>
<answer>data structure_11332861.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>recursive function</about>
<about>Hanoi Tower</about>
<source>spring</source>
<date>Wed Oct 24 14:33:39 2007</date>
<type>程式設計</type>
<content>寫下搬動河內塔的遞迴函式，令三個塔分別是\'X\', \'Y\', \'Z\'，若剛開始的 5 個圓盤都放在 \'Y\'，最後要搬到 \'Z\'，寫下呼叫您函式的方法。</content>
<answer>data structure_11332697.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>time complexity</about>
<about>program</about>
<source>spring</source>
<date>Wed Oct 24 14:28:43 2007</date>
<type>計算</type>
<content>
What is the time complexity of the following algorithm? 以與 n1, n2, n3 來表示。
</content>
<answer>data structure_11332401.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>data structure</course>
<about>time complexity</about>
<about>Big O</about>
<about>Omega</about>
<about>Theta</about>
<source>spring</source>
<date>Wed Oct 24 14:26:40 2007</date>
<type>是非題</type>
<content>是非題
n! = O(nn)
C++ 的 class 中之 constructor 與 destructor 都不能有參數。
n2.00001 + n2 log n = Ө(n2log n)
The worst case of selection sort for n elements is Ө(n2).
若 f(n) =  (g(n)) 則 f(n) = O(g(n)) 且 f(n) = (g(n))。</content>
<answer>data structure_11332278.odp</answer>
<comment>2007平常測驗一</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>single source shortest paths</about>
<about>directed acyclic graphs</about>
<about>topological sort</about>
<source>spring</source>
<date>Wed Oct 24 14:18:29 2007</date>
<type>執行演算法</type>
<content>Run DAG-SHORTEST-PATHS on the directed graph of Figure 24.5, using vertex r as the source.</content>
<answer>algorithms_11331787.odp</answer>
<comment>習題24.2-1</comment>
</record><record>
<course>algorithms</course>
<about>shortest paths</about>
<about>single source shortest paths</about>
<about>Bellman-Ford</about>
<about>negative edge</about>
<source>spring</source>
<date>Wed Oct 24 14:14:54 2007</date>
<type>執行演算法</type>
<content>Run the Bellman-Ford algorithm on the directed graph of Figure 24.4, using vertex z as the source.</content>
<answer>algorithms_11331572.odp</answer>
<comment>習題24.1-1</comment>
</record><record>
<course>algorithms</course>
<about>minimum spanning tree</about>
<about>Prim\'s algorithm</about>
<source>spring</source>
<date>Wed Oct 24 6:21:34 2007</date>
<type>計算</type>
<content>Is the Fibonacci-heap implementation of Prim\'s algorithm asymptotically faster than the binary-heap implementation for a sparse graph G = (V, E), where |E| = Θ(V)? What about for a dense graph, where |E| = Θ(V2)? How must |E| and |V| be related for the Fibonacci-heap implementation to be asymptotically faster than the binary-heap implementation?</content>
<answer>algorithms_11303172.odp</answer>
<comment>習題23.2-3</comment>
<comment>2007隨堂測驗</comment>
</record><record>
<course>algorithms</course>
<about>minimum spanning tree</about>
<source>spring</source>
<date>Wed Oct 24 6:19:17 2007</date>
<type>證明</type>
<content>Let (u, v) be a minimum-weight edge in a graph G. Show that (u, v) belongs to some minimum spanning tree to G.</content>
<answer>algorithms_11303035.odp</answer>
<comment>習題23.1-3</comment>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>string</about>
<about>failure function</about>
<source>spring</source>
<date>Wed Oct 24 6:06:55 2007</date>
<type>計算</type>
<content>若 failure function 改成下列定義，上面兩個字串的 failure functions 的值會是多少？
 (a).01210101201;
 (b).aabbaabbbab;</content>
<answer>data structure_11302293.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>string</about>
<about>failure function</about>
<source>spring</source>
<date>Wed Oct 24 6:04:44 2007</date>
<type>計算</type>
<content>以下列 failure function 的定義，計算下面兩個字串的 failure functions。
 (a).01210101201;
 (b).aabbaabbbab;</content>
<answer>data structure_11302162.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>string</about>
<about>failure function</about>
<source>spring</source>
<date>Wed Oct 24 6:01:22 2007</date>
<type>計算</type>
<content>若 failure function 改成下列定義，上面兩個字串的 failure functions 的值會是多少？
(a).abaaab;
(b).ababaa;</content>
<answer>data structure_11301960.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>string</about>
<about>failure function</about>
<source>spring</source>
<date>Wed Oct 24 5:58:38 2007</date>
<type>計算</type>
<content>以下列 failure function 的定義，計算下面兩個字串的 failure functions。
(a) abaaab;
(b) ababaa;</content>
<answer>data structure_11301796.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>complexity</about>
<about>class</about>
<source>spring</source>
<date>Tue Oct 9 21:37:01 2007</date>
<type>是非題</type>
<content>是非題
A. The worst case of binary search for n elements is Ө(n).
B. C++ 的 class 中 constructor 與 destructor 都不能有傳回值資料型態。
C. n2.0001+ n2log n = Ө(n2log n)
D. C++ 的 class 中，放在 public 後面的 data member 或 member function 都不能被類別以外的程式呼叫。</content>
<answer>data structure_10062099.odp</answer>
<comment>2007年隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>complexity</about>
<about>Theta</about>
<source>spring</source>
<date>Tue Oct 9 21:34:07 2007</date>
<type>證明題</type>
<content>證明或反證下列的式子， n2/ log n = (n2)。</content>
<answer>data structure_10061924.odp</answer>
<comment>2007年隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>complexity</about>
<about>class</about>
<source>spring</source>
<date>Tue Oct 9 21:32:04 2007</date>
<type>是非題</type>
<content>是非題
A. The worst case of selection sort for n elements is Ө(n).
B. n1.001 + n log n = Ө(n log n)
C. C++ 的 class 中 constructor 與 destructor 都不能有傳回值資料型態。
D. C++ 的 class 中 constructor 與 destructor  都不能有參數。</content>
<answer>data structure_10061802.odp</answer>
<comment>2007年隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>complexity</about>
<about>big O</about>
<source>spring</source>
<date>Tue Oct 9 21:29:40 2007</date>
<type>證明</type>
<content>證明或反證下列的式子，n2log n = O(n2)</content>
<answer>data structure_10061658.odp</answer>
<comment>2007年隨堂測驗</comment>
</record><record>
<course>interconnection networks</course>
<about>minimum degree</about>
<about>connectivity</about>
<about>edge connectivity</about>
<source>spring</source>
<date>Tue Oct 9 21:22:31 2007</date>
<type>畫圖</type>
<content>請畫一個滿足下列性質的圖形 G，κ(G) = 4, λ(G) = 6,  δ(G) = 7。</content>
<answer>interconnection networks_10061229.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>interconnection networks</course>
<about>vertex cut</about>
<about>edge cut</about>
<source>spring</source>
<date>Tue Oct 9 21:19:29 2007</date>
<type>畫圖</type>
<content>請分別畫出一個下列圖形的 κ-cut 與 λ-cut。</content>
<answer>interconnection networks_10061047.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>algorithms</course>
<about>breadth-first search</about>
<about>bipartite graph</about>
<source>spring</source>
<date>Wed Oct 3 17:35:26 2007</date>
<type>設計演算法</type>
<content>There are two types of professional wrestlers(摔角選手): \"good guys\" and \"bad guys\". Between any pair of professional wrestlers, there may or may not be a rivalry(競賽). Suppose we have n professional wrestlers and we have a list of r pairs of wrestlers for which there are rivalries. Given an O(n+r)-time algorithm that determines whether it is possible to designate some of the wrestlers as good guys and the remainder as bad guys such that each rivalry is between a good guy and a bad guy. If it is possible to perform such a designation, your algorithm should produce it.</content>
<answer>algorithms_9529204.odp</answer>
<comment>習題22.2-6</comment>
</record><record>
<course>algorithms</course>
<about>breadth-first search</about>
<source>spring</source>
<date>Wed Oct 3 17:25:59 2007</date>
<type>執行演算法</type>
<content>Show the d and π values that result from running breadth-first search on the undirected graph of Figure 22.3, using vertex u as the source.</content>
<answer>algorithms_9528637.odp</answer>
<comment>習題22.2-2</comment>
</record><record>
<course>algorithms</course>
<about>graphs</about>
<about>adjacency list</about>
<about>adjacency matrix</about>
<about>square of a graph</about>
<source>spring</source>
<date>Wed Oct 3 16:09:44 2007</date>
<type>基本性質</type>
<content>The square of a directed graph G = (V, E) is the graph G2 = (V, E2) such that (u, w) ∈ E2 if and only if for some v ∈ V, both (u, v) ∈ E and (v, w)  ∈ E. That is, G2 contains an edge between u and w whenever G contains a path with exactly two edges between u and w. Describe efficient algorithms for computing G2 from G for both the adjacency-list and adjacency-matrix representations of G. Analyze the running times of your algorithms.</content>
<answer>algorithms_9524062.odp</answer>
<comment>習題22.1-5</comment>
</record><record>
<course>algorithms</course>
<about>graphs</about>
<about>基本性質</about>
<about>multigraph</about>
<source>spring</source>
<date>Wed Oct 3 15:44:43 2007</date>
<type>基本性質</type>
<content>Given an adjacency-list representation of a multigraph G = (V, E), describe an O(V + E)-time algorithm to compute the adjacency-list representation of the \"equivalent\" undirected graph G\' = (V, E\'), where E\' consists of the edges in E with all multiple edges between two vertices replaced by a single edge and with all self-loops removed.</content>
<answer>algorithms_9522561.odp</answer>
<comment>習題22.1-4</comment>
</record><record>
<course>algorithms</course>
<about>graphs</about>
<about>基本性質</about>
<about>indegree</about>
<about>outdegree</about>
<source>spring</source>
<date>Wed Oct 3 15:35:16 2007</date>
<type>基本性質</type>
<content>Given an adjacency-list representation of a directed graph, how long does it take to compute the out-degree of every vertex? How long does it take to compute the in-degrees?</content>
<answer>algorithms_9521994.odp</answer>
<comment>習題22.1-1</comment>
</record><record>
<course>algorithms</course>
<about>graphs</about>
<about>breadth-fire search</about>
<source>spring</source>
<date>Wed Oct 3 12:42:37 2007</date>
<type>執行演算法</type>
<content>Show the d and π values that result from running breadth-first search on the following directed graph, using vertex 3 as the source.</content>
<answer>algorithms_9511635.odp</answer>
<comment>習題22.2-1</comment>
</record><record>
<course>algorithms</course>
<about>graphs</about>
<about>sinker</about>
<source>spring</source>
<date>Wed Oct 3 12:40:26 2007</date>
<type>設計演算法</type>
<content>When an adjacency-matrix representation is used, most graph algorithms require time Ω(V2), but there are some exceptions. Show that determining whether a directed graph G contains a universal sink – a vertex with in-degree |V| - 1 and out-degree 0 – can be determined in time O(V), given an adjacency matrix for G.</content>
<answer>algorithms_9511504.odp</answer>
<comment>習題22.1-6</comment>
</record><record>
<course>data structure</course>
<about>complexity</about>
<about>big-O</about>
<about>big-Omega</about>
<source>spring</source>
<date>Tue Oct 2 21:15:31 2007</date>
<type>證明</type>
<content>Show that the following equalities are correct:
a) 5n2 + 6n = O(n2)
b) 33n3 – 20n2 = (n3)</content>
<answer>data structure_9456008.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>recursive function</about>
<source>spring</source>
<date>Tue Oct 2 21:12:56 2007</date>
<type>程式設計</type>
<content>寫一個C++的遞迴函式來計算下列遞迴方程式的fi。</content>
<answer>data structure_9455854.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>recursive function</about>
<about>lcm</about>
<about>gcd</about>
<source>spring</source>
<date>Mon Oct 1 11:33:14 2007</date>
<type>程式設計</type>
<content>如何求三個整數的 gcd 與 lcm 呢？</content>
<answer>data structure_9334672.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>recursive function</about>
<about>lcm</about>
<source>spring</source>
<date>Mon Oct 1 11:32:13 2007</date>
<type>程式設計</type>
<content>利用 gcd 的函式如何求最小公倍數？lcm(m,n)</content>
<answer>data structure_9334611.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>recursive function</about>
<about>gcd</about>
<source>spring</source>
<date>Mon Oct 1 11:30:53 2007</date>
<type>程式設計</type>
<content>寫一個遞迴函式、用輾轉相除法來計算最大公因數gcd，遞迴方程式如下：假設 m ≥ n。</content>
<answer>data structure_9334531.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binomial coefficient</about>
<about>recursive function</about>
<source>spring</source>
<date>Sat Sep 29 6:12:59 2007</date>
<type>程式設計</type>
<content>請寫一個遞迴函式來計算「從 n 個不同的東西挑出 m 個的方法數」，遞迴公式是：C(n, m) = C(n-1, m) + C(n-1, m-1)，而 C(n, 0) = C(n, n) = 1。</content>
<answer>data structure_9142657.odp</answer>
<comment>習題</comment>
</record><record>
<course>algorithms</course>
<about>disjoint sets</about>
<about>union and find</about>
<about>習題</about>
<source>spring</source>
<date>Wed Sep 26 13:47:36 2007</date>
<type>證明</type>
<content>Show that any sequence of m Make-set, Find-set, and Union operations, where all the Union operations appear before any of the Find-set operations, takes only O(m) time if both path compression and union by rank are used. What happens in the same situation if only the path-compression heuristic is used?</content>
<answer>algorithms_8910734.odp</answer>
<comment>習題21.3-4</comment>
</record><record>
<course>algorithms</course>
<about>disjoint sets</about>
<about>union and find</about>
<source>spring</source>
<date>Wed Sep 26 13:43:00 2007</date>
<type>執行演算法</type>
<content>0~11的數字，假設一開始每個數字都是一個集合，用union by rank與path compression作以下的運作，請畫出最後的結果。Union(0, 1), Union(2, 3), Union(6, 7), Union(8, 9), Union(10, 11), Union(0, 2), Union(8, 10), Union(0, 4), Union(4, 5), Find-set(6), Union(0, 8), Union(4, 6), Find-set(8)。</content>
<answer>algorithms_8910458.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>graphs</about>
<about>tree</about>
<about>diameter</about>
<source>spring</source>
<date>Tue Sep 25 16:21:27 2007</date>
<type>設計演算法</type>
<content>Given an efficient algorithm to compute the diameter of a tree, and analyze the running time of your algorithm.</content>
<answer>algorithms_8833565.odp</answer>
<comment>習題 22.2-7</comment>
</record><record>
<course>interconnection networks</course>
<about>graphs</about>
<about>基本性質</about>
<source>spring</source>
<date>Tue Sep 25 13:59:26 2007</date>
<type>畫圖</type>
<content>請畫 出下列圖形 G 的 induced subgraph G[{1,2,3, 6,7, 8}]</content>
<answer>interconnection networks_8825044.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>interconnection networks</course>
<about>graphs</about>
<about>基本性質</about>
<source>spring</source>
<date>Tue Sep 25 13:57:26 2007</date>
<type>證明</type>
<content>Show that for any bipartite graph G, ε(G) ≤ 1/4 υ2 if υ is even and ε(G) ≤ 1/4 (υ – 1)(υ + 1) if υ is odd, where υ = υ(G).</content>
<answer>interconnection networks_8824924.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>interconnection networks</course>
<about>graphs</about>
<about>isomorphic</about>
<source>spring</source>
<date>Tue Sep 25 13:55:39 2007</date>
<type>證明</type>
<content>請證明下列兩個圖形是 isomorphic。</content>
<answer>interconnection networks_8824817.odp</answer>
<comment>2007隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>shortest paths</about>
<about>single source shortest paths</about>
<about>Dijstra\'s algorithm</about>
<about>graph</about>
<source>spring</source>
<date>Wed Sep 12 17:40:38 2007</date>
<type>執行演算法</type>
<content>請找出下圖中的 D 到其他所有點的 shortest paths。</content>
<answer>data structure_7715115.odp</answer>
<comment>2006隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>spanning tree</about>
<about>depth-first search</about>
<about>breadth-first search</about>
<source>spring</source>
<date>Wed Sep 12 15:55:45 2007</date>
<type>執行演算法</type>
<content>找出下圖中以 A 為起點的一個 DFS spanning tree 與一個 BFS spanning tree.(忽略邊的 weight)</content>
<answer>data structure_7708822.odp</answer>
<comment>2006隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>minimum cost spanning tree</about>
<about>Prim\'s algorithm</about>
<about>Kruskal\'s algorithm</about>
<about>Sollin\'s algorithm</about>
<source>spring</source>
<date>Wed Sep 12 15:48:07 2007</date>
<type>執行演算法</type>
<content>請分別用Kruskal’s algorightm、Prim’s algorithm(以C為起點)與Sollin\'s algorithm找下圖的minimum cost spanning tree。請寫下加edges的順序。</content>
<answer>data structure_7708365.odp</answer>
<comment>2006隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>graphs</about>
<about>degree</about>
<about>depth-first search</about>
<about>breadth-first search</about>
<source>spring</source>
<date>Wed Sep 12 15:21:25 2007</date>
<type>基本性質</type>
<content>For the digraph in below obtain
(A) the in-degree and out-degree of each vertex
(B) its adjacency-matrix
(C) its adjacency-list representation
(D) its DFS(5) spanning tree
(E) its BFS(3) spanning tree</content>
<answer>data structure_7706763.odp</answer>
<comment>2006隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>Ackermann\'s function</about>
<about>recursive function</about>
<source>spring</source>
<date>Wed Sep 12 14:50:57 2007</date>
<type>計算</type>
<content>What are the values of  the Ackermann\'s functions A(2, 2), A(2, 3), A(3, 1), and A(3, 2)?</content>
<answer>data structure_7704935.odp</answer>
<comment>2006隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>tree traversal</about>
<about>preorder</about>
<about>level-order</about>
<source>spring</source>
<date>Wed Sep 12 14:44:34 2007</date>
<type>執行演算法</type>
<content>Draw two binary trees with the same preorder sequence and the same level-order sequence.</content>
<answer>data structure_7704552.odp</answer>
<comment>2006隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>trees</about>
<about>binary tree</about>
<source>spring</source>
<date>Wed Sep 12 14:37:28 2007</date>
<type>執行演算法</type>
<content>How many are the numbers of distinct binary trees having 5 and 6 nodes?</content>
<answer>data structure_7704126.odp</answer>
<comment>2006隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>tree traversal</about>
<about>preorder</about>
<about>inorder</about>
<source>spring</source>
<date>Wed Sep 12 14:34:53 2007</date>
<type>執行演算法</type>
<content>Let T be a binary tree. The preorder sequence and inorder sequence of T are abdehklicfgj and dbaklheifcjg, respectively. Please draw the binary tree T.</content>
<answer>data structure_7703971.odp</answer>
<comment>2006隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>tree</about>
<about>heap</about>
<source>spring</source>
<date>Wed Sep 12 10:55:45 2007</date>
<type>執行演算法</type>
<content>在右邊的 max heap 中連續作下列兩個運算、並畫出每個運算後的結果。A)delete maximum  B) insert 23</content>
<answer>data structure_7690823.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>selection tree</about>
<about>winner tree</about>
<about>loser tree</about>
<source>spring</source>
<date>Wed Sep 12 10:27:47 2007</date>
<type>執行演算法</type>
<content>用 8, 9, 6, 12, 21, 13, 7, 15 建一個 winner tree 與一個 loser tree.</content>
<answer>data structure_7689145.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary search tree</about>
<source>spring</source>
<date>Wed Sep 12 10:23:12 2007</date>
<type>執行演算法</type>
<content>在右圖這個 binary search tree中連續作下面的運算、畫出每個運算之後的結果。a. insert 3, b. delete 10, c. delete 12, d. delete 8。</content>
<answer>data structure_7688870.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>trees</about>
<about>binary tree</about>
<source>spring</source>
<date>Wed Sep 12 9:59:37 2007</date>
<type>基本性質</type>
<content>Let T be a binary tree with 12 leaves. How many nodes of degree 2 does T have?</content>
<answer>data structure_7687455.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>trees</about>
<about>binary tree</about>
<about>complete binary tree</about>
<source>spring</source>
<date>Wed Sep 12 9:57:54 2007</date>
<type>計算</type>
<content>Let T be a complete binary tree with 23 nodes. What is the height of T?</content>
<answer>data structure_7687352.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>trees</about>
<source>spring</source>
<date>Wed Sep 12 9:56:10 2007</date>
<type>計算</type>
<content>Let T be a tree with 20 nodes. Assume that every node of T has 4 pointers to its children.  How many pointers of T are 0?</content>
<answer>data structure_7687248.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>generalized lists</about>
<source>spring</source>
<date>Wed Sep 12 9:52:01 2007</date>
<type>計算</type>
<content>請用 generalized list 的方式畫出多項式 3x2y8z2 + 4x3y2z2 + 2x4y4z + 3x3y4z2 + 2y2z 的 list。</content>
<answer>data structure_7686999.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>generalized lists</about>
<about>depth</about>
<source>spring</source>
<date>Wed Sep 12 9:14:27 2007</date>
<type>計算</type>
<content>What is the depth of the following generalized list ?</content>
<answer>data structure_7684745.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>generalized lists</about>
<about>polynomial</about>
<source>spring</source>
<date>Wed Sep 12 9:11:18 2007</date>
<type>計算</type>
<content>請用 generalized list 的方式畫出下列兩個多項式的 lists。A. 3x3y ＋ 4x2y B. 3x7y3z2 + 4x6y2z2 + 2x4y4z + 3x3y4z2 + 2y2z</content>
<answer>data structure_7684556.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>equivalence class</about>
<source>spring</source>
<date>Wed Sep 12 8:47:51 2007</date>
<type>執行演算法</type>
<content>令S = {0,1,2,3,4,5,6,7,8,9,10,11,12,13}， pairs of equivalence relation: 0 ≡ 1, 4 ≡ 13, 6 ≡ 9, 1 ≡ 10, 11 ≡ 12, 4 ≡ 5, 2 ≡ 8, 0 ≡ 9, 1 ≡ 11, 7 ≡ 10，請輸出其 equivalence class</content>
<answer>data structure_7683149.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>polynomial</about>
<source>spring</source>
<date>Wed Sep 12 8:41:04 2007</date>
<type>執行演算法</type>
<content>請畫出下列兩個多項式相加之後的結果。</content>
<answer>data structure_7682742.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>equivalence class</about>
<source>spring</source>
<date>Wed Sep 12 8:37:28 2007</date>
<type>執行演算法</type>
<content>令S = {0,1,2,3,4,5,6,7,8,9,10,11,12}， pairs of equivalence relation: 0 ≡ 3, 4 ≡ 7, 6 ≡ 9, 10 ≡ 1, 12 ≡ 11, 5 ≡ 4, 8 ≡ 2, 9 ≡ 0, 11 ≡ 1, 7 ≡ 10，請輸出其 equivalence class</content>
<answer>data structure_7682526.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>linked lists</about>
<about>polynomial</about>
<source>spring</source>
<date>Wed Sep 12 8:24:59 2007</date>
<type>執行演算法</type>
<content>請畫出下列兩個多項式相加之後的結果。</content>
<answer>data structure_7681777.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>prefix form</about>
<about>postfix form</about>
<source>spring</source>
<date>Tue Sep 11 15:25:12 2007</date>
<type>計算</type>
<content>將 + – / * a + b c d e f 轉成 postfix form</content>
<answer>data structure_7620590.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>evaluate</about>
<about>prefix form</about>
<source>spring</source>
<date>Tue Sep 11 15:22:29 2007</date>
<type>計算</type>
<content>計算 +  /  *  4  –  3  2  2  5 的值。</content>
<answer>data structure_7620427.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>infix form</about>
<about>prefix form</about>
<about>postfix form</about>
<source>spring</source>
<date>Tue Sep 11 15:20:44 2007</date>
<type>執行演算法</type>
<content>將 A + (B * C + E) / (F + A) * D + C  轉成 postfix 與 prefix form。</content>
<answer>data structure_7620322.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>tree traversal</about>
<about>inorder</about>
<about>preorder</about>
<source>spring</source>
<date>Tue Sep 11 15:12:53 2007</date>
<type>執行演算法</type>
<content>請畫出符合inorder sequence為 f d g b e a h c j i k，而preorder sequence為a b d f g e c h i j k 的binary tree。</content>
<answer>data structure_7619851.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>disjoint sets</about>
<about>union and find</about>
<source>spring</source>
<date>Tue Sep 11 15:07:26 2007</date>
<type>執行演算法</type>
<content>0~11的數字，假設一開始每個數字都是一個集合，用weighting rule for union與Collapsing rule for find作以下的運作，請畫出最後的結果。union(0, 1), union(2, 3), union(4, 5), union(6, 7), union(8, 9), union(10, 11), union(0, 2), union(4, 6), union(8, 10), union(0, 4), find(7), union(0, 8), find(11)。</content>
<answer>data structure_7619524.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>tree traversal</about>
<about>forest</about>
<about>inorder</about>
<about>preorder</about>
<source>spring</source>
<date>Tue Sep 11 14:56:33 2007</date>
<type>執行演算法</type>
<content>請寫出下列forest的preorder與inorder traversal, tree的順序是由左到右。</content>
<answer>data structure_7618871.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>selection tree</about>
<about>winner tree</about>
<about>loser tree</about>
<source>spring</source>
<date>Tue Sep 11 14:51:47 2007</date>
<type>執行演算法</type>
<content>十六個非遞減數列的第一個數字分別為12, 25, 6, 8, 10, 2, 13, 17, 22, 11, 3, 24, 5, 15, 19, 23，請畫出其winner tree與loser tree。</content>
<answer>data structure_7618585.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary search tree</about>
<source>spring</source>
<date>Tue Sep 11 14:41:07 2007</date>
<type>執行演算法</type>
<content>請對下圖這個binary search tree連續作下列的運算：a. Insert 28, b. delete 15, c. delete 30, d. insert 36,e. delete 20</content>
<answer>data structure_7617945.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>heap</about>
<source>spring</source>
<date>Tue Sep 11 14:13:22 2007</date>
<type>執行演算法</type>
<content>請對右上圖這個max heap連續作下列的運算：a. Insert 18, b. insert 13, c. delete max, d. insert 11</content>
<answer>data structure_7616280.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>tree traversal</about>
<source>spring</source>
<date>Mon Sep 10 16:49:06 2007</date>
<type>執行演算法</type>
<content>請對下圖分別作inorder, preorder, postorder, level-order traversal，請寫出每一種輸出的結果。</content>
<answer>data structure_7539224.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<source>spring</source>
<date>Mon Sep 10 16:42:54 2007</date>
<type>基本性質</type>
<content>請問高度為k的binary tree最多有幾個點？
若binary tree T有15個leaf，請問它有幾個degree為2的點？
T為一個32個點的complete binary tree，請問T的高度是多少？</content>
<answer>data structure_7538852.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>threaded binary tree</about>
<source>spring</source>
<date>Mon Sep 10 16:38:49 2007</date>
<type>基本性質</type>
<content>Threaded binary trees與原來的binary trees有何不同？
Threaded binary trees的比原來的binary trees多了哪些部份？</content>
<answer>data structure_7538607.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<source>spring</source>
<date>Mon Sep 10 16:34:45 2007</date>
<type>基本性質</type>
<content>請問copy一個n個點的binary tree的時間複雜度是多少？
判斷兩個n個點的binary trees是否完全相等，其時間複雜度是多少？</content>
<answer>data structure_7538363.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>satisfiablity problem</about>
<source>spring</source>
<date>Mon Sep 10 16:32:41 2007</date>
<type>基本性質</type>
<content>請問下列satisfiability problem的答案是true還是false？(x1 or -x2) and (-x1 or x3) and -x3 and (x3 or  x2)</content>
<answer>data structure_7538239.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>tree traversal</about>
<source>spring</source>
<date>Mon Sep 10 16:27:13 2007</date>
<type>執行演算法</type>
<content>請對下圖分別作inorder, preorder, postorder, level-order traversal，請寫出每一種輸出的結果。請問前面幾種tree traversal的時間複雜度是多少？</content>
<answer>data structure_7537911.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<source>spring</source>
<date>Mon Sep 10 16:23:27 2007</date>
<type>基本性質</type>
<content>請畫一個6個點的complete binary tree。</content>
<answer>data structure_7537685.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<source>spring</source>
<date>Mon Sep 10 16:19:47 2007</date>
<type>基本性質</type>
<content>請問一個binary tree最少有幾個點？
請問n層的binary tree最多有幾個點？
若binary tree T有8個leaf，請問它有幾個degree為2的點？
T為一個18個點的complete binary tree，請問T的高度是多少？</content>
<answer>data structure_7537465.odp</answer>
<comment>2005隨堂測驗</comment>
</record><record>
<course>data structure</course>
<about>Ackermann\'s function</about>
<about>recursive function</about>
<source>spring</source>
<date>Sat Sep 8 19:13:58 2007</date>
<type>程式設計</type>
<content>Write a recursive function for computing the Ackermann\'s function A(m, n).</content>
<answer>data structure_7375116.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>equivalence classes</about>
<about>linked list</about>
<source>spring</source>
<date>Sat Sep 8 10:56:51 2007</date>
<type>執行演算法</type>
<content>共有 0~14 的元素，輸入1 ≡ 2, 2 ≡ 8, 2 ≡ 13, 3 ≡ 6, 4 ≡ 7, 4 ≡ 10, 6 ≡ 7, 9 ≡ 12, 11 ≡ 13，請問其 equivalence classes 共有哪些？</content>
<answer>data structure_7345289.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>prefix form</about>
<about>evaluate</about>
<source>spring</source>
<date>Sat Sep 8 10:40:32 2007</date>
<type>計算</type>
<content>Evaluate the following prefix expression:
 / + / * 8 5 4 + 6 2 3</content>
<answer>data structure_7344310.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>prefix form</about>
<about>postfix form</about>
<source>spring</source>
<date>Sat Sep 8 10:38:38 2007</date>
<type>執行演算法</type>
<content>Write the postfix form of the following prefix expression: + a * b * / c + + d e a b</content>
<answer>data structure_7344196.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>prefix form</about>
<about>infix form</about>
<source>spring</source>
<date>Sat Sep 8 10:30:58 2007</date>
<type>執行演算法</type>
<content>Write the prefix form of the following infix expressions:
A)   a / (b  * c + d)		
B)   – (a – b) * (c / d) || e / (a ＆＆ b – c) ＆＆ d</content>
<answer>data structure_7343736.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>Ackermann\'s function</about>
<about>recursive function</about>
<source>spring</source>
<date>Sat Sep 8 8:44:25 2007</date>
<type>計算</type>
<content>The definition of Ackermann\'s function is as follows. What are the values of  A (2, 1), A(2, 2), A(3,1) and A(4, 1)?</content>
<answer>data structure_7337342.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>disjoint set</about>
<about>union and find</about>
<source>spring</source>
<date>Sat Sep 8 8:38:37 2007</date>
<type>執行演算法</type>
<content>假設有0~9共十個數字，一開始每個數字都是一個集合，用 weighting rule 與 collapsing rule 作集合的union and find，請畫出作完下列運算之後的集合。union(0, 3), union(1, 5), union(2, 9), union(0, 2), union(8, 1),  union(1, 0), union(4, 6), union(4, 0), find(8), find(6)</content>
<answer>data structure_7336995.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<source>spring</source>
<date>Sat Sep 8 8:26:44 2007</date>
<type>證明</type>
<content>請證明：For any nonempty binary tree T, if n0 is the number of leaf nodes and n2 is the number of nodes of degree 2, then n0 = n2 + 1.</content>
<answer>data structure_7336282.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>selection tree</about>
<about>winner tree</about>
<about>loser tree</about>
<source>spring</source>
<date>Sat Sep 8 8:21:47 2007</date>
<type>執行演算法</type>
<content>若有八個遞增數列要作merge，八個數列的第一個元素分別為：3,  9, 2, 7, 16, 4, 15, 6，請畫出一開始的winner tree與loser tree。若第三個數列在 2 之後的元素為8，請畫出輸出最小值、 補上另一個數字之後的 winner tree 與 loser tree。</content>
<answer>data structure_7335985.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>heap</about>
<source>spring</source>
<date>Sat Sep 8 8:13:38 2007</date>
<type>執行演算法</type>
<content>請在圖二的 max heap 中連續作以下的運算：(a) delete max (b) insert 28  (c) insert 32。請畫出每次運算、調整結束後的heap。</content>
<answer>data structure_7335496.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>tree traversal</about>
<about>inorder</about>
<about>level-order</about>
<source>spring</source>
<date>Sat Sep 8 7:52:39 2007</date>
<type>建 binary tree</type>
<content>The inorder sequence and level-order sequence of a binary tree T are ECFBGDHAIKMLNJ and ABICDJEFGHKLMN, respectively. Please draw the binary tree T.</content>
<answer>data structure_7334237.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>binary search tree</about>
<source>spring</source>
<date>Sat Sep 8 7:16:53 2007</date>
<type>執行演算法</type>
<content>將圖一當作一個binary search tree來看待，請連續作下列的運算：(a). insert 10 (b). delete 4 	(c) delete  15  (d) delete 8  (e) insert 9。畫出每個運算之後的binary search tree。</content>
<answer>data structure_7332090.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>tree traversal</about>
<about>preorder</about>
<about>postorder</about>
<about>level-order</about>
<source>spring</source>
<date>Fri Sep 7 22:12:58 2007</date>
<type>執行演算法</type>
<content>Write the inorder, preorder, postorder, and level-order sequence of the tree in Figure 1.</content>
<answer>data structure_7299456.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>disjoint sets</about>
<about>weighting rule</about>
<source>spring</source>
<date>Fri Sep 7 16:49:57 2007</date>
<type>證明</type>
<content>假設一開始每棵 tree 都只有一個點，之後用 weighting rule 的方式作 union，若最後有一棵 tree T 的點數為 m，請證明 T 的高度不會超過 ⌊log2 m⌋ + 1。</content>
<answer>data structure_7280075.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>disjoint sets</about>
<about>union and find</about>
<source>spring</source>
<date>Fri Sep 7 16:46:41 2007</date>
<type>執行演算法</type>
<content>假設有0~8共九個數字，一開始每個數字都是一個集合，用 weighting rule 與 collapsing rule 作集合的union and find，請畫出作完下列運算之後的集合。union(0, 1), union(2, 3), union(2, 4), union(5, 6), union(7, 0), union(2, 0), union(2, 8), union(5, 2), find(7)</content>
<answer>data structure_7279879.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>matrix multiplication</about>
<source>spring</source>
<date>Fri Sep 7 16:33:38 2007</date>
<type>計算</type>
<content>請問6個矩陣相乘共有幾種不同的乘法順序？6個點的binary tree 共有幾種？</content>
<answer>data structure_7279096.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>selection tree</about>
<about>winner tree</about>
<about>loser tree</about>
<source>spring</source>
<date>Fri Sep 7 16:29:45 2007</date>
<type>執行演算法</type>
<content>若有八個遞增數列要作merge，八個數列的第一個元素分別為：7, 8, 9, 3, 7, 6, 4, 2，請畫出一開始的winner tree與loser tree。假設最後一個數列中2之後為5，當輸出最小值之後的 winner tree 與 loser tree 會變成什麼樣子。</content>
<answer>data structure_7278863.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>heap</about>
<source>spring</source>
<date>Fri Sep 7 16:13:52 2007</date>
<type>執行演算法</type>
<content>請在圖二的 max heap 中作以下的運算：(a) insert 32  (b) insert 23  (c) delete max。請畫出每次運算、調整結束後的heap。</content>
<answer>data structure_7277910.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>stack</about>
<about>排列</about>
<source>spring</source>
<date>Fri Sep 7 15:42:02 2007</date>
<type>計算</type>
<content>將 1, 2, ..., n 的數字按照順序放到 stack 裡面並輸出，當 n = 3 與 n = 4 時，其輸出的順序各有哪些？</content>
<answer>data structure_7276000.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>postfix form</about>
<about>evaluate</about>
<source>spring</source>
<date>Fri Sep 7 15:37:06 2007</date>
<type>計算</type>
<content>Compute the value of the following postfix form expressions:
a. 7 8 – 6 4 2 * / + 		
b. 3 8 1 2 * – + 4 5 6 – * +</content>
<answer>data structure_7275704.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>postfix form</about>
<about>infix form</about>
<source>spring</source>
<date>Fri Sep 7 15:33:42 2007</date>
<type>執行演算法</type>
<content>Write the postfix form of the following expressions:
A) A / (b  * - (c + d))		
B) (A + B) * D + E * (F + A / D) + C</content>
<answer>data structure_7275500.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>maze</about>
<source>spring</source>
<date>Fri Sep 7 15:12:45 2007</date>
<type>maze 設計</type>
<content>請設計一個 7 × 5 的迷宮，使得課本的 maze 演算法執行的路徑最長。</content>
<answer>data structure_7274243.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>maze</about>
<source>spring</source>
<date>Fri Sep 7 14:54:48 2007</date>
<type>執行演算法</type>
<content>下方 6 × 7 的迷宮用課本老鼠走迷宮的演算法來走，請畫出所走出來的路徑。左上方為入口、右下方為出口。</content>
<answer>data structure_7273166.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>failure function</about>
<source>spring</source>
<date>Fri Sep 7 14:42:01 2007</date>
<type>計算</type>
<content>Compute the failure function for each of the following patterns
1). b  a  a  b  a  b  a  a  b  b  a  b  a  a
2). b  c  d  a  a  b  c  d  a  b  c  d  a  a  a</content>
<answer>data structure_7272399.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>time complexity</about>
<source>spring</source>
<date>Fri Sep 7 9:12:42 2007</date>
<type>證明</type>
<content>Prove or disprove the following equalities
1) 24n2– 1000n = Ө(n2) 		
2) n2/ log n = Ө(n2)</content>
<answer>data structure_7252640.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>tree traversal</about>
<about>inorder</about>
<about>postorder</about>
<about>tree</about>
<source>spring</source>
<date>Sun Aug 26 6:06:10 2007</date>
<type>執行演算法</type>
<content>The inorder sequence and postorder sequence of a binary tree T are CEDFBAHKJLIG and EFDCBKLJIHGA, respectively. Please draw the binary tree T.</content>
<answer>data structure_6204648.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>binary search tree</about>
<source>spring</source>
<date>Sun Aug 26 5:48:42 2007</date>
<type>執行演算法</type>
<content>將圖一當作一個binary search tree來看待，請連續作下列的運算：(a). insert 11 (b). delete 5 (c) delete  6  (d) delete 12 (e) insert 7。畫出每個運算之後的binary search tree。</content>
<answer>data structure_6203600.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>tree traversal</about>
<about>inorder</about>
<about>level-order</about>
<source>spring</source>
<date>Sun Aug 26 5:21:09 2007</date>
<type>執行演算法</type>
<content>Write the inorder, preorder, postorder, and level-order sequence of the tree in 圖一。</content>
<answer>data structure_6201947.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>depth-first spanning tree</about>
<about>depth first number</about>
<about>biconnected components</about>
<about>graph</about>
<source>spring</source>
<date>Sat Aug 25 17:44:08 2007</date>
<type>執行演算法</type>
<content>請畫出一個圖五以3為起點的 DFS spanning tree，算出每個點的 depth-first number，並計算每個點的 low，最後請寫出這個圖的 articulation points。</content>
<answer>data structure_6160126.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>postfix form</about>
<about>prefix form</about>
<source>spring</source>
<date>Sat Aug 25 17:07:02 2007</date>
<type>計算</type>
<content>Write the postfix form of the following prefix expression:
a). * + a b / – c d + e f 		
b). ||  ＆＆  ＞  a  b  ＜  b  c  ＜ ─  a  b  d</content>
<answer>data structure_6157900.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>tree traversals</about>
<about>graph</about>
<source>spring</source>
<date>Sat Aug 25 16:48:02 2007</date>
<type>執行演算法</type>
<content>一個binary tree的inorder與 level order sequence分別為：BHFIDAEJGKC與ABCDEFGHIJK，請畫出這個binary tree。</content>
<answer>data structure_6156760.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>shortest paths</about>
<about>all-pairs shortest paths</about>
<about>Floyd-Warshall algorithm</about>
<about>graph</about>
<source>spring</source>
<date>Sat Aug 25 16:37:43 2007</date>
<type>執行演算法</type>
<content>請找出圖四的all pairs shortest paths，寫出長度即可。</content>
<answer>data structure_6156141.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>shortest paths</about>
<about>single source shortest paths</about>
<about>Dijstra\'s algorithm</about>
<about>graph</about>
<source>spring</source>
<date>Sat Aug 25 16:20:29 2007</date>
<type>執行演算法</type>
<content>請問圖三中點A到其他點的shortest paths之長度？</content>
<answer>data structure_6155107.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>minimum cost spanning tree</about>
<about>Prim\'s algorithm</about>
<about>Kruskal\'s algorithm</about>
<about>Sollin\'s algorithm</about>
<source>spring</source>
<date>Sat Aug 25 16:05:23 2007</date>
<type>執行演算法</type>
<content>請分別用Kruskal’s algorightm、Prim’s algorithm(以C為起點)與Sollin\'s algorithm找圖二的minimum cost spanning tree。請寫下加edges的順序。</content>
<answer>data structure_6154201.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>depth first spanning tree</about>
<about>breadth first spanning tree</about>
<about>tree traversal</about>
<source>spring</source>
<date>Sat Aug 25 8:14:20 2007</date>
<type>執行演算法</type>
<content>請畫出圖一中由點4開始的一個DFS spanning tree與一個BFS spanning tree；並各給一個DFS與BFS的拜訪順序。</content>
<answer>data structure_6125938.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>Binomial heap</about>
<source>spring</source>
<date>Fri Aug 24 22:02:09 2007</date>
<type>執行演算法</type>
<content>Assume that Figure 4 is a Binomial heap. Draw the result after insert 16 and then delete 42.</content>
<answer>data structure_6089207.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>Fibonacci heap</about>
<source>spring</source>
<date>Fri Aug 24 21:59:51 2007</date>
<type>執行演算法</type>
<content>Assume that Figure 4 is a Fibonacci heap. Draw the result after insert 16 and then delete 42.</content>
<answer>data structure_6089068.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>shortest paths</about>
<about>all-pairs shortest paths</about>
<source>spring</source>
<date>Fri Aug 24 21:58:50 2007</date>
<type>執行演算法</type>
<content>Find all-pairs of shortest paths of Figure 3.</content>
<answer>data structure_6089008.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>depth-first spanning tree</about>
<about>breadth-first spanning tree</about>
<about>spanning tree</about>
<source>spring</source>
<date>Fri Aug 24 21:57:38 2007</date>
<type>執行演算法</type>
<content>Draw a depth-first spanning tree and a breadth-first spanning tree for Figure 2 with root 5.</content>
<answer>data structure_6088936.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>binary tree</about>
<about>tree traversals</about>
<source>spring</source>
<date>Fri Aug 24 21:56:08 2007</date>
<type>執行演算法</type>
<content>Write out the inorder, preorder, postorder, and level-order traversals for the binary tree of the Figure 1.</content>
<answer>data structure_6088846.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>tree</about>
<about>binary tree</about>
<source>spring</source>
<date>Fri Aug 24 21:53:17 2007</date>
<type>計算</type>
<content>How many distinct binary trees are there with 6 nodes?</content>
<answer>data structure_6088675.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>prefix</about>
<about>postfix</about>
<about>infix</about>
<source>spring</source>
<date>Fri Aug 24 21:51:22 2007</date>
<type>計算</type>
<content>Write the postfix and prefix of the following expressions: A + ( B * C + E ) / ( F + A ) * D + C.</content>
<answer>data structure_6088560.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>failure function</about>
<source>spring</source>
<date>Fri Aug 24 21:47:20 2007</date>
<type>計算</type>
<content>Compute the values of failure function for each of the following patterns:
a、a b a a b a a b b
b、b b b b a a b b b</content>
<answer>data structure_6088318.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>function</about>
<about>recursive</about>
<source>spring</source>
<date>Fri Aug 24 21:44:51 2007</date>
<type>程式設計</type>
<content>The Fibonacci numbers are defined as: f0= 0, f1= 1, and fi= fi-1+ fi-2for i> 1. Write a recursive function to compute fi with C++ language.</content>
<answer>algorithms_6088169.odp</answer>
<comment></comment>
</record><record>
<course>data structure</course>
<about>algorithms</about>
<about>data structure</about>
<about>time complexity</about>
<source>spring</source>
<date>Fri Aug 24 21:39:52 2007</date>
<type>證明</type>
<content>Prove or disprove the the following statements.
a、n! = O(nn).
b、10n2= Ω(n3).</content>
<answer>ds_6087870.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>greedy algorithm</about>
<about>task-scheduling problem</about>
<source>spring</source>
<date>Tue Jul 24 17:29:26 2007</date>
<type>執行演算法</type>
<content>Solve the instance of the scheduling problem given in the follows.</content>
<answer>algorithms_3394444.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>greedy algorithm</about>
<about>Huffman code</about>
<source>spring</source>
<date>Tue Jul 24 17:21:50 2007</date>
<type>執行演算法</type>
<content>What is an optimal Huffman code for the following set of frequencies?   a:1  b:5  c:7  d:10  e:15  f:23  g:31  h:40 。</content>
<answer>algorithms_3393988.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>greedy algorithm</about>
<about>knapsack</about>
<about>0-1 knapsack</about>
<source>spring</source>
<date>Tue Jul 24 17:08:47 2007</date>
<type>執行演算法</type>
<content>下表中代表每個物品的重點(wi)與價值(pi)，請問袋子最多可裝15公斤時，所能裝的物品價值最高為何？請求knapsack 與 0-1 knapsack  的答案。</content>
<answer>algorithms_3393205.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>greedy algorithm</about>
<about>activity selection</about>
<source>spring</source>
<date>Tue Jul 24 16:52:45 2007</date>
<type>執行演算法</type>
<content>找出下表中所能參加最多的 activities。</content>
<answer>algorithms_3392243.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>dynamic programming</about>
<about>longest common subsequence</about>
<source>spring</source>
<date>Tue Jul 24 16:18:47 2007</date>
<type>執行演算法</type>
<content>Determine an LCS of &#9001;1,0,0,1,0,1,0,1&#9002; and &#9001;0, 1, 0, 1, 1, 0, 1, 1, 0&#9002;.</content>
<answer>algorithms_3390205.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>dynamic programming</about>
<about>Matrix-chain multiplication</about>
<source>spring</source>
<date>Tue Jul 24 8:17:53 2007</date>
<type>執行演算法</type>
<content>Find an optimal parenthesization of a matrix-chain product whose sequence of dimensions is &#9001;5, 3, 12, 5, 6&#9002;.</content>
<answer>algorithms_3361351.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>dynamic programming</about>
<about>Matrix-chain multiplication</about>
<source>spring</source>
<date>Tue Jul 24 7:52:31 2007</date>
<type>執行演算法</type>
<content>Find an optimal parenthesization of a matrix-chain product whose sequence of dimensions is &#9001;5, 10, 3, 50, 6&#9002;.</content>
<answer>algorithms_3359829.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>dynamic programming</about>
<source>spring</source>
<date>Tue Jul 24 7:34:31 2007</date>
<type>執行演算法</type>
<content>找出下列問題的最短路徑。</content>
<answer>algorithms_3358749.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>dynamic programming</about>
<source>spring</source>
<date>Tue Jul 24 7:15:00 2007</date>
<type>執行演算法</type>
<content>找出下列問題的最短路徑。</content>
<answer>algorithms_3357578.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>order-statistic tree</about>
<about>data structure</about>
<source>spring</source>
<date>Mon Jul 23 7:40:50 2007</date>
<type>設計演算法</type>
<content>Show how to use an order-statistic tree to count the number of inversions (see Problem 2-4) in an array of size n in time O(n lg n).</content>
<answer>algorithms_3272728.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>red black tree</about>
<about>data structure</about>
<source>spring</source>
<date>Mon Jul 23 7:32:04 2007</date>
<type>執行運算</type>
<content>Show the red-black trees that result after successively inserting the keys 41, 38, 31, 12, 19, 8 into an initially empty red-black tree. And then show the red-black trees that result from the successive deletion of the keys in the order 8, 12, 19, 31, 38, 41.</content>
<answer>algorithms_3272202.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>binary search tree</about>
<about>red black tree</about>
<source>spring</source>
<date>Sun Jul 22 20:16:43 2007</date>
<type>計算</type>
<content>Describe a red-black tree on n keys that realizes the largest possible ratio of red internal nodes to black internal nodes. What is this ratio? What tree has the smallest possible ratio, and what is the ratio?</content>
<answer>algorithms_3231681.odp</answer>
<comment>習題13.1-7</comment>
</record><record>
<course>algorithms</course>
<about>red black tree</about>
<source>spring</source>
<date>Sun Jul 22 20:12:56 2007</date>
<type>計算</type>
<content>What is the largest possible number of internal nodes in a red-black tree with black-height k? What is the smallest possible number?</content>
<answer>algorithms_3231454.odp</answer>
<comment>習題13.1-6</comment>
</record><record>
<course>algorithms</course>
<about>binary search tree</about>
<about>sorting</about>
<source>spring</source>
<date>Sun Jul 22 8:08:30 2007</date>
<type>分析演算法</type>
<content>We can sort a given set of n numbers by first building a binary search tree containing these numbers(using TREE_INSERT repreatedly to insert the numbers one by one) and then printing the numbers by an inorder tree walk. What are the worst-case and best-case running times for this sorting algorithm?</content>
<answer>algorithms_3187988.odp</answer>
<comment>習題12.3-3</comment>
</record><record>
<course>algorithms</course>
<about>binary search tree</about>
<source>spring</source>
<date>Sun Jul 22 8:00:59 2007</date>
<type>選擇題</type>
<content>Suppose that we have numbers between 1 and 1000 in a binary search tree and want to search for the number 363. Which of the following sequences could not be the sequence of nodes examined?
a. 2, 252, 401, 398, 330, 344, 397, 363.
b. 924, 220, 911, 244, 898, 258, 362, 363.
c. 925, 202, 911, 240, 912, 245, 363.
d. 2, 399, 387, 219, 266, 382, 381, 278, 363.
e. 935, 278, 347, 621, 299, 392, 358, 363.</content>
<answer>algorithms_3187537.odp</answer>
<comment>習題12.2-1</comment>
</record><record>
<course>algorithms</course>
<about>binary search tree</about>
<source>spring</source>
<date>Sat Jul 21 11:43:17 2007</date>
<type>畫圖</type>
<content>For the set of keys {1, 4, 5, 10, 16, 17, 21}, draw binary search trees of height 2, 3, 4, 5, and 6.</content>
<answer>algorithms_3114475.odp</answer>
<comment>習題12.1-1</comment>
</record><record>
<course>algorithms</course>
<about>hashing functions</about>
<source>spring</source>
<date>Sat Jul 21 11:35:28 2007</date>
<type>計算</type>
<content>Consider inserting the keys 10, 22, 31, 4, 15, 28, 17, 88, 59 into a hash table of length m = 11 using open addressing with the auxiliary hash function h\'(k) = k mod m. Illustrate the result of inserting these keys using linear probing, using quadratic probing with c1 = 1 and c2 = 3, and using double hashing with h2(k) = 1 + (k mod (m-1)).</content>
<answer>algorithms_3114006.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>tree</about>
<source>spring</source>
<date>Sat Jul 21 11:21:28 2007</date>
<type>畫圖</type>
<content>Draw the binary tree rooted at index 6 that is represented by the follow fields.</content>
<answer>algorithms_3113166.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>stack</about>
<about>queue</about>
<source>spring</source>
<date>Sat Jul 21 11:15:45 2007</date>
<type>設計資料結構</type>
<content>Show how to implement a queue using two stacks. Analyze the running time of the queue operations.</content>
<answer>algorithms_3112823.odp</answer>
<comment>習題10.1-6</comment>
</record><record>
<course>algorithms</course>
<about>selection</about>
<about>randomized algorithms</about>
<source>spring</source>
<date>Sat Jul 21 11:08:17 2007</date>
<type>執行演算法</type>
<content>Suppose we use Randomized-Select to select the minimum element of the array A = &#9001;3, 2, 9, 0, 7, 5, 4, 8, 6, 1&#9002;. Describe a sequence of partitions that results in a worst-case performance of Randomized-Select.</content>
<answer>algorithms_3112375.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>quick sort</about>
<about>randomized algorithms</about>
<source>spring</source>
<date>Sat Jul 21 10:57:28 2007</date>
<type>分析演算法</type>
<content>During the running of the procedure Randomized-Quicksort, how many calls are made to the random-number generator Random in the worst case? How about in the best case? Give your answer in terms of Θ-notation.</content>
<answer>algorithms_3111725.odp</answer>
<comment>習題7.3-2</comment>
</record><record>
<course>algorithms</course>
<about>quick sort</about>
<source>spring</source>
<date>Sat Jul 21 10:41:23 2007</date>
<type>修改演算法</type>
<content>How would you modify Quicksort to sort into nonincreasing order?</content>
<answer>algorithms_3110761.odp</answer>
<comment>習題7.1-4</comment>
</record><record>
<course>algorithms</course>
<about>quick sort</about>
<about>time complexity</about>
<source>spring</source>
<date>Sat Jul 21 10:38:03 2007</date>
<type>簡答</type>
<content>What is the time complexity of Quicksort when the array A contains distinct elements and is sorted in decreasing order ?</content>
<answer>algorithms_3110561.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>heap</about>
<source>spring</source>
<date>Sat Jul 21 10:32:25 2007</date>
<type>計算</type>
<content>令 H 是一個 48 個元素的 heap，請問 H 中有幾個高度為 3 的 nodes？</content>
<answer>algorithms_3110223.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>heap</about>
<source>spring</source>
<date>Sat Jul 21 10:17:03 2007</date>
<type>執行演算法</type>
<content>Perform the operation of Build-Max-Heap on the array A = &#9001;5, 3, 17, 10, 84, 19, 6, 22, 9&#9002;.</content>
<answer>algorithms_3109301.odp</answer>
<comment>習題6.3-1</comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>heap</about>
<source>spring</source>
<date>Sat Jul 21 10:08:00 2007</date>
<type>執行演算法</type>
<content>Perform the operation of Max-Heapify(A, 3) on the array A = &#9001;27, 17, 3, 16, 13, 10, 1, 5, 7, 12, 4, 8, 9, 0&#9002;.</content>
<answer>algorithms_3108758.odp</answer>
<comment>習題6.2-1</comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>heap</about>
<source>spring</source>
<date>Sat Jul 21 10:01:20 2007</date>
<type>計算</type>
<content>What are the minimum and maximum numbers of elements in a heap of height h?</content>
<answer>algorithms_3108358.odp</answer>
<comment>習題6.1-1</comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>heap</about>
<source>spring</source>
<date>Sat Jul 21 9:15:54 2007</date>
<type>簡答</type>
<content>Is the sequence &#9001;23, 17, 14, 6, 13, 10, 1, 5, 7, 12&#9002; a max-heap?</content>
<answer>algorithms_3105632.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>heap</about>
<source>spring</source>
<date>Sat Jul 21 9:07:47 2007</date>
<type>簡答</type>
<content>Is an array that is in sorted order a min-heap?</content>
<answer>algorithms_3105145.odp</answer>
<comment>習題6.1-5</comment>
</record><record>
<course>algorithms</course>
<about>data structure</about>
<about>heap</about>
<source>spring</source>
<date>Sat Jul 21 9:03:58 2007</date>
<type>簡答</type>
<content>Where in a max-heap might the smallest element reside, assuming that all elements are distinct?</content>
<answer>algorithms_3104915.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<about>recursive</about>
<about>master theorem</about>
<source>spring</source>
<date>Sat Jul 21 8:59:57 2007</date>
<type>計算</type>
<content>Give asymptotic upper and lower bounds for T(n) in each of the following recurrences. Assume that T(n) is constant for n &#8804; 2.
A.T(n) = 2T(n/2) + n2.
B.T(n) = 16T(n/4) + n2.
C.T(n) = 3T(n/2) + n lg n.</content>
<answer>algorithms_3104675.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<about>recursive</about>
<source>spring</source>
<date>Sat Jul 21 8:49:32 2007</date>
<type>計算</type>
<content>Solve the recurrence T(n) = 2T(n1/2) + 1 by making a change of variables. We can assume that T(1) = θ(1).</content>
<answer>algorithms_3104050.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<about>introduction</about>
<source>spring</source>
<date>Sat Jul 21 8:39:37 2007</date>
<type>證明</type>
<content>Show that if f(n) and g(n) are monotonically increasing functions, then so are the functions f(g(n)).</content>
<answer>algorithms_3103455.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>function</about>
<about>introduction</about>
<source>spring</source>
<date>Sat Jul 21 8:34:51 2007</date>
<type>證明</type>
<content>Show that if f(n) and g(n) are monotonically increasing functions, then so are the functions f(n) + g(n).</content>
<answer>algorithms_3103169.odp</answer>
<comment></comment>
</record><record>
<course>algorithms</course>
<about>Getting Started</about>
<about>inversion</about>
<source>spring</source>
<date>Thu Jul 12 11:36:37 2007</date>
<type>基本定義</type>
<content>List the inversions of the array &#9001;3, 6, 8, 1, 5&#9002;.</content>
<answer>algorithms_2336475.odp</answer>
<comment></comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammars</about>
<source>曾俊淞</source>
<date>Fri Jun 15 11:24:40 2007</date>
<type>設計 grammars</type>
<content>習題5.1.8(h)</content>
<answer>formal languages_2958.odp</answer>
<comment></comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>context-free grammars</about>
<source>曾凱煌</source>
<date>Fri Jun 15 11:07:13 2007</date>
<type>設計 grammars</type>
<content>習題5.1.7(g)</content>
<answer>formal languages_1911.odp</answer>
<comment></comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>simple grammars</about>
<source>蕭旻昆</source>
<date>Fri Jun 15 11:01:33 2007</date>
<type>設計 grammars</type>
<content>習題5.2.3</content>
<answer>formal languages_1571.odp</answer>
<comment></comment>
</record><record>
<course>formal languages</course>
<about>context-free languages</about>
<about>regular grammars</about>
<about>ambiguous</about>
<source>吳忠融</source>
<date>Fri Jun 15 10:56:52 2007</date>
<type>ambiguous 證明</type>
<content>習題5.2.11</content>
<answer>formal languages_1290.odp</answer>
<comment></comment>
</record>
</article>

