Category: algorithms
Teaching Kids Programming: Videos on Data Structures and Algorithms Introduction to Stack Stack is an important and commonly-used data structure that implements First In Last Out. The first item …
Teaching Kids Programming: Videos on Data Structures and Algorithms Mathematically, the Fibonacci Numbers are: Fibonacci Number – Recursion def f(n): if n == 0: return 0 if n == …
Given a string s , find the length of the longest substring t that contains at most 2 distinct characters. Example 1: Input: “eceba” Output: 3 Explanation: t is …
Teaching Kids Programming: Videos on Data Structures and Algorithms Linear Search Algorithm to Find Square Root Taking sqrt(n) for example, the linear search (a kind of a bruteforce search …
Given a list of integers nums, return whether it represents a max heap. That is, for every i we have that: nums ≥ nums if 2*i + 1 is …