Add multilingual language and systems learning tracks
This commit is contained in:
1 parent
07338189fc
commit
d8d1c40118
844 files changed
+6061
No files matched your search
@@ -0,0 +1,9 @@
|
||||
# Algorithms & Data Structures · 1
|
||||
|
||||
[Agila University track](https://edu.agilaos.com/track.php?track=26&lang=en)
|
||||
|
||||
About 15 minutes per lesson. Predict, run, change, explain, then complete the check in University.
|
||||
|
||||
- [Lesson 1: Count the work in a search](lesson-1/lesson.html)
|
||||
- [Lesson 2: Use a queue when order matters](lesson-2/lesson.html)
|
||||
- [Lesson 3: Binary search needs an invariant](lesson-3/lesson.html)
|
||||
@@ -0,0 +1,7 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Count the work in a search</title><h1>Count the work in a search</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Linear search may inspect every element. Count comparisons for a match at the start, a match at the end, and a missing value. Big-O describes growth, not a measured duration on your machine. Compare sizes 10, 100, and 1000 before choosing a different structure.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">items=list(range(10))
|
||||
checks=0
|
||||
for value in items:
|
||||
checks+=1
|
||||
if value==9:break
|
||||
print(checks)
|
||||
</code></pre><p><strong>Expected result:</strong> <code>10</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,6 @@
|
||||
items=list(range(10))
|
||||
checks=0
|
||||
for value in items:
|
||||
checks+=1
|
||||
if value==9:break
|
||||
print(checks)
|
||||
@@ -0,0 +1,7 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Use a queue when order matters</title><h1>Use a queue when order matters</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>FIFO removes the oldest item first. Use a deque for a work queue instead of repeatedly removing index zero from a long list. Specify capacity and what happens when it fills. Test empty, one-item, and full states; an efficient structure still needs a correct policy.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">from collections import deque
|
||||
queue=deque(["A","B"])
|
||||
print(queue.popleft())
|
||||
queue.append("C")
|
||||
print(list(queue))
|
||||
</code></pre><p><strong>Expected result:</strong> <code>A
|
||||
['B', 'C']</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
from collections import deque
|
||||
queue=deque(["A","B"])
|
||||
print(queue.popleft())
|
||||
queue.append("C")
|
||||
print(list(queue))
|
||||
@@ -0,0 +1,8 @@
|
||||
<!doctype html><html lang="en"><meta charset="utf-8"><title>Binary search needs an invariant</title><h1>Binary search needs an invariant</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>Binary search relies on sorted data and a shrinking search interval. A faster loop on unsorted data can return a wrong answer. Use a library operation, test insertion at both ends and an existing value, then explain the invariant before implementing your own.</p><p><strong>Practice and evidence:</strong> Predict the example or draw its state transitions. Change one assumption, test the boundary, and record the actual result. Explain what this small model does not establish about a production system.</p><pre><code class="language-python">from bisect import bisect_left
|
||||
values=[2,4,6]
|
||||
print(bisect_left(values,1))
|
||||
print(bisect_left(values,4))
|
||||
print(bisect_left(values,8))
|
||||
</code></pre><p><strong>Expected result:</strong> <code>0
|
||||
1
|
||||
3</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p></html>
|
||||
@@ -0,0 +1,5 @@
|
||||
from bisect import bisect_left
|
||||
values=[2,4,6]
|
||||
print(bisect_left(values,1))
|
||||
print(bisect_left(values,4))
|
||||
print(bisect_left(values,8))
|
||||
Reference in new issue
Block a user