الوحدة 8 · CS353

🎯 أهداف التعلم

Input Enhancement Prestructuring
$$C(n) = \sum_{i=0}^{n-2} \sum_{j=i+1}^{n-1} 1 = \frac{n(n-1)}{2}$$
Pseudocode
ALGORITHM ComparisonCountingSort(A[0..n-1])
//Sorts an array by comparison counting
for i <- 0 to n-1 do Count[i] <- 0
for i <- 0 to n-2 do
    for j <- i+1 to n-1 do
        if A[i] < A[j]
            Count[j] <- Count[j] + 1
        else
            Count[i] <- Count[i] + 1
for i <- 0 to n-1 do S[Count[i]] <- A[i]
return S
$$O(m \times n)$$
Pseudocode
ALGORITHM ShiftTable(P[0..m-1])
for i <- 0 to size-1 do Table[i] <- m
for j <- 0 to m-2 do Table[P[j]] <- m - 1 - j
return Table
🗺️ Horspool’s Algorithm
Horspool's Algorithm Boyer-Moore Algorithm
$$d = \max \{d_1, d_2\} \quad \text{where} \quad d_1 = \max\{t_1(c) - k, 1\}$$
🎓

حديث البروفيسور

❓ اسأل البروفيسور

البطاقات التعليمية

اختبر نفسك

1 / 10 🎯 نتيجتك: 0

🔐 خزنة الامتحان

⚠️ فخ / Trap
🔑 مفهوم أساسي / Key Concept
🤫 سر / Secret
⚠️ فخ / Trap
🔑 مفهوم أساسي / Key Concept