← All lectures
Practical · P06

A terminal practice tool for Algorithms & Data Structures

donelabtoolproblems

terminal only. if that's already a problem, this isn't for you.

adscb update

a practice tool for Algorithms & Data Structures for Computational Biology. you pick a problem, write your solution in your own editor, run one command, see what broke.

the data structures match the pseudocode from the slides — 1-indexed Array, SLList, Stack with .top as an integer, circular Queue. your code looks like the blackboard. that's the whole point.

full details and repo → github.com/mahmoudxyz/adscb


install

pipx install git+https://github.com/mahmoudxyz/adscb.git
adscb update

no pipx:

pip install --user git+https://github.com/mahmoudxyz/adscb.git

just trying it out:

git clone https://github.com/mahmoudxyz/adscb.git && cd adscb
pip install --user rich
python -m adscb.cli list

the loop

adscb list                   # see all problems
adscb start ch00/01_hello    # creates your file, shows the problem
adscb edit  ch00/01_hello    # opens $EDITOR
adscb test  ch00/01_hello    # runs tests
adscb hint  ch00/01_hello    # one hint at a time

adscb list

start with ch00/01_hello — it's a 2-line warmup just to learn the workflow. then go to ch04/.

adscb test


staying current

adscb update    # pulls new problems, never touches your solutions
adscb sync      # something went wrong? wipe and re-clone

adscb update


the primitives

from adscb.primitives import Array, SLList, Stack, CircularQueue, NIL

A = Array(5)     # 1-indexed. A[0] raises IndexError. intentional.
S = Stack(10)
S.top            # integer, 0 = empty
NIL              # just None, but it reads better

every primitive tracks .ops — handy for checking complexity empirically.


what's in there

chapterproblems
Ch 0 — Intro1 warmup
Ch 4 — Elementary Data Structures19 problems

more chapters coming: sorting, trees, graphs, DP, BWT.