Angles are often used in Computer Science especially when creating 2D or 3D user interfaces. Angle measurements are given in either radians or degrees. In this blog post we will use degrees. As the angle increase, the name of the…
Variables are used in nearly every single computer program. They are an essential concept and can be used and manipulated using many different techniques. The following spider diagram summarises the key computing concepts linked to the use of variables in…
Weather Data for Quebec City, Canada For this challenge we will use a two-dimensional array (in Python a list of lists) to store the average temperature (in Celsius degrees) and the rainfall (in mm) for each of the twelve months…
In Mathematics, the factorial of n is denoted by n! and calculated by the product of integer numbers from 1 to n. For instance: In this challenge you will write a program using Little Man Computer to ask the user…
Write an LMC program to let the user enter two numbers, num1 and num2. The program should output the results of multiplying these two numbers: num1 x num2. LMC Simulators Online LMC Simulator Alternative LMC Simulator Solution While checking the…
Write an LMC program to let the user enter a number n. The program should calculate the output n + (n-1) + (n-2) + … + 3 + 2 + 1. For instance if the user enters the value 5.…
Write an LMC program to let the user enter a PIN code to deactivate a burglar alarm. The program should let the user have up to 3 attempts to enter the correct PIN code before starting the alarm. The correct…
Binary trees are useful data structures used to solve specific computational problems. They provide a visual representation of how data can be stored and linked. Computers use linked lists to store the information of binary trees. This blog post will…
A binary expression tree is a specific kind of a binary tree used to represent expressions. Two common types of expressions that a binary expression tree can represent are algebraic expressions and boolean expressions. These trees can represent expressions that…
In this blog post we will investigate four key algorithms used to read through the content of a binary tree: Breadth-First Traversal Algorithm Depth-First Algorithms: Pre-Order Traversal In-Order Traversal Post-Order Traversal Binary Tree? A Binary Tree is a data structure…