Category Archives: Basic Physics

Depth‑First Search (DFS) Classic AI Algorithms

Simple Python Example The code below shows a recursive DFS on an undirected graph represented as an adjacency list.Vertices are numbered starting from 0. Expected output Iterative (stack‑based) version If you prefer an explicit stack (e.g., to avoid Python’s recursion limit), here’s a compact iterative version: Both implementations produce the same visitation order; choose the style that best… Read More »

Period (T) and Frequency (f) – A Simple Explanation

Period (T) Frequency (f) Relationship Period and Frequency are inversely proportional to each other. They are related by the following formulas: f=1T T=1f Feature Period (T) Frequency (f) Meaning Time for one cycle Cycles per second Unit Seconds (s) Hertz (Hz) Relationship T = 1/f f = 1/T Analogy: “By the way, ocean waves travel through water, and… Read More »