AlgoPlus//structures / directory
Read the theory

Directory & Free Space

A tree of files, and the bit vector that tracks which disk blocks are free.

Free blocks
0
Step
1/1
Legend
Folder / changed bit
Used block (1)
Free block (0)
AI Tutor Workspace
In a nutshell
A directory is how files are organised for people: folders nested inside folders, with a path naming the route to each file. Separately, the file system has to remember which disk blocks are free. A bit vector does this with one bit per block — 1 for used, 0 for free — so creating a file just flips some 0s to 1s and deleting one flips them back.
Ready
Press play to begin the cinematic walkthrough.
A tree-structured directory organises files into nested folders, while a free-space bit vector (one bit per block) tracks what is used vs free, so allocation and deletion are just bit flips.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Directory & Free Space.