10 Data Structure & Algorithms Books Every Programmer Should Read

A collection of awesome Algorithms books which should find a place in every programmer’s book self. Includes language specific books in Java, Python, and JavaScript for easy learning. Algorithms are language agnostic and any programmer worth their salt should be able to convert them to code in their programming language of choice. » Hacker Noon | hackernoon.com

21 de junio de 2019 · 1 min · 57 palabras · Nacho Cano

10 Data Structure, Algorithms, and Programming Courses to Crack Any Coding Interview

Many junior developers dream of making it at one of the larger tech companies, but, to be honest with you, getting your first job is never easy. It is, in fact, one of the hardest things in your life and you need to put your best effort to find a job in your dream company. » Hacker Noon | hackernoon.com

26 de octubre de 2018 · 1 min · 60 palabras · Nacho Cano

Programming Pearls and Python fails

Computer science books contains timeless wisdom, but performance advice doesn’t always age well. When reading Programming Pearls, by Jon Bentley, I’ve found more modern hardware advances that puts conventional wisdom on its head. » Franklin He | medium.com

22 de septiembre de 2016 · 1 min · 38 palabras · Nacho Cano

Demystifying the regular expression that checks if a number is prime

A while back I was researching the most efficient way to check if a number is prime. This lead me to find the following piece of code: public static boolean isPrime(int n) { return !new String(new char[n]).matches(”.?|(..+?)\\1+”); } I was intrigued. While this might not be the most efficient way, it’s certainly one of the less obvious ones, so my curiosity kicked in. How on Earth could a match for the .?|(..+?)\1+ regular expression tell that a number is not prime (once it’s converted to its unary representation)? ...

10 de septiembre de 2016 · 1 min · 92 palabras · Nacho Cano

Probability, Paradox, and the Reasonable Person Principle

In this notebook, we cover the basics of probability theory, and show how to implement the theory in Python. » Peter Norvig | nbviewer.ipython.org

17 de octubre de 2015 · 1 min · 24 palabras · Nacho Cano

Las matemáticas explican por qué no puedes ganar al Tetris hagas lo que hagas

“La única forma de ganar es no jugar”. Tom Murphy, programador, creó en 2013 un programa que era capaz de aprender a jugar a Super Mario Bros de forma que en sucesivas partidas conseguía salvar los distintos obstáculos que se encontraba el personaje hasta ganar el juego. Cuando enfrentó su software al Tetris, sin embargo, Murphy se encontró con que no había victoria posible. » R. Pérez | elconfidencial.com

5 de mayo de 2015 · 1 min · 69 palabras · Nacho Cano

Proving that Android’s, Java’s and Python’s sorting algorithm is broken (and showing how to fix it)

Tim Peters developed the Timsort hybrid sorting algorithm in 2002. It is a clever combination of ideas from merge sort and insertion sort, and designed to perform well on real world data. TimSort was first developed for Python, but later ported to Java (where it appears as java.util.Collections.sort and java.util.Arrays.sort) by Joshua Bloch (the designer of Java Collections who also pointed out that most binary search algorithms were broken). TimSort is today used as the default sorting algorithm for Android SDK, Sun’s JDK and OpenJDK. Given the popularity of these platforms this means that the number of computers, cloud services and mobile phones that use TimSort for sorting is well into the billions. Fast forward to 2015. After we had successfully verified Counting and Radix sort implementations in Java (J. Autom. Reasoning 53(2), 129-139) with a formal verification tool called KeY, we were looking for a new challenge. TimSort seemed to fit the bill, as it is rather complex and widely used. Unfortunately, we weren’t able to prove its correctness. A closer analysis showed that this was, quite simply, because TimSort was broken and our theoretical considerations finally led us to a path towards finding the bug (interestingly, that bug appears already in the Python implementation). This blog post shows how we did it. ...

28 de febrero de 2015 · 2 min · 220 palabras · Nacho Cano

Who invented pointers, amortized complexity, and more?

Andrey Kolmogorov, Fred Hennie, Richard Stearns, and Walter Savitch are all famous separately; but they have something in common. Read on, and see. Today I wish to discuss some algorithmic tricks and show that they were initially used by complexity theorists, years before they were used by algorithm designers. To steal a phrase: it`s computational complexity all the way down. Well not exactly. The situation is slightly more complex”a bad pun. The complexity theorists often invented a concept and used it in a narrow way, while later it was rediscovered and made a general notion. ...

9 de septiembre de 2014 · 1 min · 100 palabras · Nacho Cano

Visualizing Algorithms

Algorithms are a fascinating use case for visualization. To visualize an algorithm, we don’t merely fit data to a chart; there is no primary dataset. Instead there are logical rules that describe behavior. This may be why algorithm visualizations are so unusual, as designers experiment with novel forms to better communicate. This is reason enough to study them. But algorithms are also a reminder that visualization is more than a tool for finding patterns in data. Visualization leverages the human visual system to augment human intellect: we can use it to better understand these important abstract processes, and perhaps other things, too. ...

29 de junio de 2014 · 1 min · 107 palabras · Nacho Cano

Tetris Printer Algorithm

The algorithm converts pixels from a source image into squares in the Tetris playfield, one row at a time from the bottom up. To generate an individual square, the algorithm assembles a structure consisting of a rectangular region fully supported by a single square protruding from the bottom. When the rectangular region is completed, its rows are cleared, leaving behind the protruding square. Three examples of the process appear below ...

5 de junio de 2013 · 1 min · 75 palabras · Nacho Cano