Giter Site home page Giter Site logo

algolang's Introduction

Algorithms in Golang

A lot of introductory algorithms courses use a dynamic language like Python or Javascript because there is an idea that it will be "easier" for people to get going with. While there may be some truth to that, I believe that it is actually harder to learn algorithms with a dynamic language because too many important details are hidden, obscured or inaccessible. Things that should be fast are sometimes slow, things that should be simple are sometimes complex and trade-offs that are subtle are decided for you.

On the other hand, trying to investigate algorithms in low-level static language like C presents too many tooling challenges, language quirks and system setup pitfalls. You need to know C reasonably well before you will succeed at exploring new algorithms using it. Java might be a good choice but the amount of boilerplate needed to get a simple experiment running is tedious, and the "everything is an object" restriction can impede elegant implementations. Functional languages are awesome but they abstract over the details of the computation so well that I don't think they are useful for the first steps toward learning to think like a computer.

For these reasons, I think Golang is actually a stand-out choice for exploring algorithms. It has a simple syntax that mostly gets out of your way, it has excellent and well-documented tooling that you can use to check your implementations (including benchmarking), and it gives you enough access to low-level primitives to get a solid grasp on what the computer is doing.

Implementations

So far I have implemented:

  • Quicksort
  • Binary trees
  • Array shuffle
  • Binary search with benchmarks
  • Min Heap

WIP

  • Bloom filter
  • Fibonnaci heap

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.