Skip to content

Instantly share code, notes, and snippets.

View BrandonDyer64's full-sized avatar

Brandon Dyer BrandonDyer64

View GitHub Profile
@zac-xin
zac-xin / AddBinary.java
Created December 26, 2012 16:58
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100".
public class Solution {
public String addBinary(String a, String b) {
// Start typing your Java solution below
// DO NOT write main() function
int la = a.length();
int lb = b.length();
int max = Math.max(la, lb);
StringBuilder sum = new StringBuilder("");
@codemonkey-uk
codemonkey-uk / astar.h
Last active May 27, 2024 01:48
The C++ header file "astar.h" implements the A* graph search (route finding) algorithm using a C++ function template. The interface is written in an STL like style.
// -------------------------------------------------------------------------
// Filename: astar.h
// Version: 3
// Purpose: Provide template for a* algorithm
// (c) T.Frogley 1999-2021
// Stable and used in many projects 2003-2021+
// Updated: 2021 to better support behaviour controls, & unordered_set
// -------------------------------------------------------------------------
#ifndef ASTAR_H