# Last Updated: October 16, 2020

Welcome to the fourth episode of Algorithm Spotlight! The featured algorithm for this week is 🥁…drum roll, please…🥁 — Binary Search!

Right before we begin, if you missed out on the previous episode, here’s Kadane’s Algorithm:

# Preface

We are playing the number guessing game! I am thinking of a number that is between 0–100. If my number is 23, how can you guess my number quickly and efficiently? Welcome to the world of Binary Search.

# Part 1: The Concept of Searching

One of the most frequent daily tasks is searching through a phone book, a book from a bookshelf, etc. Luckily, in computer science, we have plenty…

## Last Updated: October 10, 2020

Welcome back to the third episode of Algorithm Spotlight! In this episode, I’ll be talking about Kadane’s Algorithm!

Right before we begin, if you missed out on the previous episode, here’s Floyd’s Cycle Detection Algorithm:

# Problem: Maximum Subarray Problem

Given an integer array `nums`, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.

Example 1:

`Input: nums = [-2,1,-3,4,-1,2,1,-5,4]Output: 6Explanation: [4,-1,2,1] has the largest subarray sum = 6.`

Example 2:

`Input: nums = [-2147483647]Output: -2147483647`

# Understanding the Problem

Right before we jump into solving this popular Maximum subarray problem, we need to understand the problem…

# Algorithm Spotlight: Floyd’s Cycle Detection Algorithm

## Last Updated: March 8, 2021

Welcome to the second week of Algorithm Spotlight! This week our featured algorithm is…drum roll please…Floyd’s Cycle Detection Algorithm!

Right before we begin, if you missed out on the previous episode, here’s the Euclidean Algorithm article:

# The Problem Statement

Given a linked list, determine if it has a cycle in it.

To represent a cycle in the given linked list, we use an integer `pos` which represents the position (0-indexed) in the linked list where the tail connects to. If `pos == -1`, then there is no cycle in the linked list.

Want to read this story later? Save it in Journal.

Example…

# Algorithm Spotlight: Euclidean Algorithm

## Last Updated: September 18, 2020

The Euclidean algorithm is an algorithm for quickly finding the GCD (greatest common divisor) of two numbers and is an extremely important number theory concept. The GCD is used in many applications, like simplifying fractions, modular arithmetic, and also encryption algorithms such as the RSA Encryption Algorithm.

# Review: Greatest Common Divisor (GCD)

The GCD is the greatest divisor that divides two numbers. For example, the gcd(21, 28) is 7, as we first list out all the factors (a number that is a divisor of a bigger number, e.g. 2 is a factor of 20):

Factors of 21: 1, 3, 7, 21

Factors of 28: 1…

# Hello world, it’s Aaron!

NOTE: This article assumes you are on a Linux distro with at least 1 CUDA-capable NVIDIA GPU.

In this article, we will be installing NVIDIA CUDA and TensorFlow GPU 2.2.0-rc2!

# Overview

There’s a very high chance that you’ve taken a Udacity course, and maybe even a nanodegree. But since Udacity believes in a “project-based, active learning” philosophy, you’re very likely to not pass Udacity projects on the first submission, or maybe the second submission. In this Medium blog post, I’ll share my tips on how to pass Udacity projects. Let’s get started!

# Tip #1: Read Udacity’s Project Rubrics!

For every project on Udacity, there are project rubrics. Make sure you check out Udacity’s project rubrics and compare it with your work. You can find my article on how to find Udacity’s Project Rubrics here.

When working on…

# Hands-On ML, Edition 2 by Aerolien Geron, Summary Part 1

This is the first part of the 2 part series by Aaron Ma on the summary of Hands-On ML.

So you may have come across the image on the left: Hands-on ML with Scikit-Learn, Keras & TensorFlow by Aurelien Geron. I’ve just finished reading his book, and I’ve decided to create a neat little summary of his book.

# I. The Fundamentals of Machine Learning

This book is divided into 2 sections. This is the 1st section’s summary. You can find the 2nd section’s summary here. The 1st section covers the following:

• What ML is, the difference between Traditional Learning and ML, etc.
• Typical steps in training…

# This Day in TensorFlow 2: tf.tpu

Hello world, it’s Aaron! Today I’ll be talking about TensorFlow 2’s amazing tf.tpu API.

NOTE: The version of TensorFlow I’m using is TensorFlow 2.1. The Python version I’m using is 3.7. I’ll also periodically update the TensorFlow & Python version used here to match the most recent releases.

# What is TensorFlow?

TensorFlow is Google’s machine learning library that is free and open-source for anyone to use. It’s written in C++ so it executes low-level, or it executes ridiculously fast.

# What is TPU?

Well, a TPU is a Tensor Processing Unit that was developed by Google Cloud. It’s a scary machine cooled by water(see picture depicted below).

# Is Brilliant Premium Worth It?

A few days ago, I received Brilliant from a friend. I practiced solving some problems on Brilliant with the Premium subscription, and I loved it! Here’s my recap & review of Brilliant Premium. Finish reading this to get a discount on Brilliant Premium!

# What is Brilliant?

Brilliant is a site that follows the freemium business model, which means, yes, you do have to pay if you want to get the value of Brilliant. Students, professionals, and life-long learners can learn about high school math and beyond at the level of the university style. You can also learn physics and computer science(like Machine Learning)…

# In-Place Algorithms

Hello, world, it’s Aaron! In this blog, I’ll be talking about an in-place algorithm, which modifies data structures or objects outside of its stack frame. An out-of-place function does not make any changes that are visible to other functions. Usually, these functions copy data structures or objects before it manipulates or changes them. Let’s take a look into this with some examples.

Thanks for reading and have a great day!

# -Aaron Ma https://aaronhma.com

## Aaron Ma

Living in The Milky Way 😀

Get the Medium app