In computer science, sorting algorithms are used to sort the elements of a data sets in numerical or alphabetical order. In this blog post will investigate the Python code used to implement 4 of the most frequently used sorting algorithms:…
The quick sort algorithm is a divide-and-conquer algorithm that can be implemented using a recursive function. The following graphic explains the different steps of a quick sort algorithm. Note, that the quick sort algorithm starts by identifying a pivot. Depending…
A tree is a complex data structure used to store data (nodes) in a “parent/child” relationship. The top node of a tree (the node with no parent) is called the root. Each node of a tree can have 0, 1…
In this challenge we will implement a backtracking algorithm to solve a game of Rush Hour using a trial and error approach. We will also investigate the need to apply some basic heuristics to improve our algorithm and avoid a…
In this challenge, we are going to use a backtracking algorithm to solve a puzzle game called Noah’s Ark. First, you will need to fully understand how the game works. You can check the “How To Play” tab on this…
The Prime Factor Tree is a visual technique used in Maths to workout all the prime factors of a large number. With this approach, all the leaf nodes (nodes without sub-branches) are the prime factors of the root node. For…
The TCP/IP protocols are a suite of protocols used to support different types of communication between devices over an IP network such as the Internet. These protocols resulted from research and development conducted by the US Defense Advanced Research Projects…
This is a confidential mission with the highest level of priority. The MI6 needs your skill to complete a very confidential mission: Mission Code: Alpha-01 Mission Priority: Critical Mission Context: The MI6 network has been hacked! As a result, all…
In this challenge we will use a Python algorithm to perform a frequency analysis of the score obtained when throwing a set of two dice. Frequency analysis using 1 dice Let’s consider a single 6-sided dice. When using single dice,…
In this challenge we will focus on using the random library to generate random numbers in Python. The randint() function is used to generate a random integer (whole number) within a given range. import random number = randint(1,100) The above…