Sliding Window Algorithm
The sliding window algorithm is a technique used to solve problems that involve finding a subset of data that meets a certain criteria. The subset of data is usually a contiguous set of elements from an array or string.
The basic idea of the sliding window technique is to keep a small subset of data (the “window”) in memory and process it in a sequential manner, moving the window through the data to process all the elements efficiently.
Two Pointers Algorithm
Roulette in C
The aim here is to develop a roulette engine in C. The engine will be able to generate a random result based on the rules of roulette. The user will be able to place bets on the result and the engine will determine if the bet is a win or a loss. Their winnings will be calculated and stored for the duration of their session.
Git Repository
Fork or browse the complete code yourself at github.com/danielhookins/cRoulette
Big O Notation
Big O notation is a way of measuring the complexity of an algorithm, which is a set of instructions used to perform a task. It is a way of expressing how long an algorithm takes to run, based on the size of the input.
The “O” in Big O notation stands for “order of.” It is used to describe the upper bound of an algorithm’s running time. For example, an algorithm with a running time of O(n)
means that the running time grows at most linearly with the size of the input (n). An algorithm with a running time of O(n^2)
means that the running time grows at most quadratically with the size of the input.
Interfaces in Go
Go is a statically-typed language with a strong emphasis on simplicity, efficiency, and readability. One of the key features of Go is its ability to define and use interfaces, which provide a way to specify the behavior of an object without requiring a specific implementation.
An interface is a defined set of method signatures - that is, it lets us know what methods must exist for a certain type.
If you come from the OOP world this may be familiar to you where interfaces can define what methods a class must have.