The Shortest Quicksort Algorithm in Python

Quicksort is not only a popular question in many code interviews – asked by Google, Facebook, and Amazon – but also a practical sorting algorithm that is fast, concise, and readable. Because of its beauty, you won’t find many introductions to algorithms that don’t discuss the Quicksort algorithm. In this one-liner tutorial, you’ll learn about … Read more

Python A* – The Simple Guide to the A-Star Search Algorithm

This tutorial guides you into the fascinating A* (A-Star) using the Python programming language. First, feel free to watch the video guide—we’ll give a detailed textual explanation below. The slides can be found as a Gif here: Okay, so let’s dive into the algorithm motivation, explanation, and Python code next! What is the A* Search … Read more

Python Dijkstra Algorithm

You can download the PDF file of the presentation here. Also, watch the presentation as a Gif here: What is Dijkstra’s Algorithm? Dijkstra’s algorithm solves the single-source shortest path (SSSP) problem. Generally, it enables finding the shortest route between two vertices in a graph. Its author is dr. Edsger W. Dijkstra, a pioneering contributor to … Read more

The Best-First Search Algorithm in Python

You can watch the slides as a GIF here: And download the slides as PDF here. What’s the Best-First Search Algorithm? After several articles on uninformed search algorithms, we continue our journey to informed search algorithms. The first one in the series is the Best-First search algorithm. In general, informed search algorithms use some kind … Read more

The Sieve of Eratosthenes in Python

Finding prime numbers is of critical importance for practical applications such as cryptography. Many public-key methods are only safe from a cryptographic point of view because it’s generally inefficient and slow to compute the prime factors of large numbers. As you go over the article, feel free to watch my explainer video on the Sieve … Read more

Python Palindromes One-Liner

This one-liner introduces another basic computer science term: palindromes. Similar to anagrams, palindromes are a popular coding interview question. First things first: What is a Palindrome? “A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam or racecar or the number 10201.“ [source] … Read more

Iterative Deepening Depth-First Search (DFS) Algorithm in Python

What is an Iterative Deepening Depth-First Search Algorithm? Continuing our story even further, after introducing graphs and basic graph traversal algorithms, we will refine the Depth-First Search Algorithm by introducing the iterative depth limitation. An iterative deepening depth-search algorithm also traverses a graph by exploring it vertex-by-vertex, but it does it by following the vertical … Read more

Cómo convertir una lista de cadenas en una lista de números en coma flotante (flotantes) en Python

La forma más pitónica de convertir una lista de cadenas en una lista de flotantes es usar una comprensión de listas floats = [float(x) for x in strings]. Recorre todos los elementos de la lista y convierte cada elemento de la lista x en un flotante utilizando la función incorporada float(x). Este artículo muestra las … Read more

Python Anagrams in One Line Python

Why Learning about Python Anagrams? A popular question in programming interviews is to create an anagram checker. The interviewer wants to test your knowledge about the basic terminology in computer science, and how good you are at developing your own simple algorithms to solve the problems you are facing. In this article, you’ll learn about … Read more

How to Use FTX REST API in Python

This article explains how to use the REST API to access FTX in Python so that you can build your trading program. As you go through the article, you can also watch our article tutorial video: What is FTX? FTX is an exchange where users can trade various digital assets, such as cryptocurrencies, tokenised stocks … Read more

Python Depth-First Search (DFS) Algorithm

What is a Depth-First Search (DFS) Algorithm? Building on our previous story about graphs and graph traversal algorithms, this time we will look into a depth-first search algorithm. A depth-search algorithm also traverses a graph by exploring it vertex-by-vertex, but it does it by following the vertical order of the vertices. Although the depth-first search … Read more