Fresh Beginning
  • Home
  • Portfolio
  • Buy Me A Coffee
  • Patreon
  • Speaking
  • Reading
  • About Me
Subscribe

Algorithm

A collection of 4 posts
[Algorithm Question] Finding the origin of a Computer Virus from the given list of machine pairs
Algorithm

[Algorithm Question] Finding the origin of a Computer Virus from the given list of machine pairs

Recently, I worked on the algorithm problem that required to find the origin of computer virus given the list of infected machine pairs. In general you're given the input in the form of computer pairs (a, b) which indicates the virus infection from machine a to machine b. The goal
Dec 2, 2020 2 min read
tic-tac-toe

Algorithm to Detect A tic tac toe Winner

Recently I was asked to work on the game of tic tac toe on iOS. Creating a game layout and rest of the business logic is straightforward, until it comes to detecting whether either side has won the game or not. There are 2 ways of solving this problem -
May 13, 2020 7 min read
A Beautiful Refactor
Algorithm

A Beautiful Refactor

For this post I am going to take a break from my regular story about how I rewrote the minesweeper game to Swift. This is more about the beautiful refactor and how I was able to eliminate lot of boilerplate code with simple algorithm to achieve what the old and
Jan 5, 2019 3 min read
Dutch National Flag / 3 Way partition problem
Interview

Dutch National Flag / 3 Way partition problem

Recently while going through interview questions, I came across this interesting problem - Called 3-way partitioning or also called as a Dutch National flag problem. In gist, the problem is given an array containing 3 distinct elements, (Say 0, 1 and 2) sort them in the increasing order. When you
Jul 12, 2017 3 min read
Fresh Beginning © 2023
Powered by Ghost