Computer Science Explained

Clear explanations of key ideas in computer science, one concept at a time.

Topics: All articles  |  Computer Science Explained  |  Exam Preparation  |  Problems and Solutions  |  Studies and Careers  |  Competition News

People sit at desktop computers in a bright training room, with a standing presenter, blue and pale green clothing, and warm-toned screens.

What Is a Stack in Computer Science and How Does Undo Use It?

November 17, 2026 · Julia Berens · Computer Science Explained

Follow three edits through an undo history to see what push, pop, and peek do and why a stack reverses the newest edit first. Read more

A grainy black-and-white photo of a person typing on a laptop beside a bright window.

How to Read a Confusion Matrix for a Spam Filter

October 22, 2026 · Julia Berens · Computer Science Explained

A spam filter can make two very different mistakes. Read the axis labels to see which count means spam got through and which means a real message was flagged. Read more

A glowing white and gray brain illustration floats against a black background patterned with faint network lines and dots.

How Does Run Length Encoding Work?

September 1, 2026 · Julia Berens · Computer Science Explained

Six black pixels in a row can share one count. But when black and white alternate, storing a count for every pixel can make the encoded row bigger. Read more

An angled close-up of a computer screen shows a dark padlock silhouette with a pale blue keyhole amid rows of white binary digits.

Why Does Dijkstra Fail With Negative Weights?

June 16, 2026 · Julia Berens · Computer Science Explained

Dijkstra settles a node at distance 2. A route through a node it has not processed yet costs just 1. Three edges show exactly where the algorithm's guarantee breaks. Read more

A grainy black-and-white view of a tabletop with cups, a saucer, and a small rectangular object.

How Does a Hash Table Work When Two Keys Share a Slot?

March 6, 2026 · Julia Berens · Computer Science Explained

Follow two library book IDs into the same slot of a tiny hash table. Then look up each ID by checking the entries in that slot. Read more

An angled close-up of a computer screen filled with rows of glowing green and teal numbers on a dark background.

What Is a Loop Invariant in a Search for the Largest Number?

November 24, 2025 · Julia Berens · Computer Science Explained

A variable called best starts with the first number in a list. Prove that it holds the largest number seen so far, and you can explain why the loop returns the right answer. Read more