ข้อ 1
[CLRS 2-3] จงเรียงฟังก์ชันเหล่านี้ เพื่อทำให้ถ้าฟังก์ชัน
มาก่อน
แล้ว
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
เฉลย
ข้อ 2
[CLRS 2-4] ให้
และ
เป็นฟังก์ชันบวกใดๆ จงพิสูจน์หรือไม่ก็แสดงว่าข้อความต่อไปนี้ไม่เป็นความจริงด้วยการแสดงข้อขัดแย้ง
- ถ้า
แล้ว
ด้วย

- ถ้า
แล้ว 

- ถ้า
แล้ว 

เฉลย
ข้อ 3
[CLRS 4-1] จงหา Big-Theta ของฟังก์ชันต่อไปนี้









เฉลย
ข้อ 4
ให้
เป็นเวลาการทำงานของอัลกอริทึมต่อไปนี้
Algorithm A(n)
{
if (n <= 1)
do something in O(1) time.
else
{
do something in O(n) time.
Call A(n/2).
Call A(n/3).
Call A(n/6).
}
}
จงหา Big-Theta ของ
เฉลย
ข้อ 5
ให้
เป็นเวลาการทำงานของอัลกอริทึมต่อไปนี้
Algorithm B(n)
{
for i = 1 to n do
{
j = 1
while (j < i)
{
j = 2*j
do something in O(1) time
}
}
}
จงหา Big-Theta ของ
เฉลย
ข้อ 6
ให้
เป็นเวลาการทำงานของอัลกอริทึมต่อไปนี้
Algorithm B(n)
{
if (n < 1)
do something in O(1) time
else
{
let k = square root of n
for j = 1 to k do
Call A(k)
do something in O(n) time
}
}
จงหา Big-Theta ของ
เฉลย