trekhleb's blog

By trekhleb, history, 6 years ago, In English

TL;DR

In this article I’m trying to explain the difference/similarities between dynamic programing and divide and conquer approaches based on two examples: binary search and minimum edit distance (Levenshtein distance).

The Problem

When I started to learn algorithms it was hard for me to understand the main idea of dynamic programming (**DP**) and how it is different from divide-and-conquer (**DC**) approach. When it gets to comparing those two paradigms usually Fibonacci function comes to the rescue as great example. But when we’re trying to solve the same problem using both DP and DC approaches to explain each of them, it feels for me like we may lose valuable detail that might help to catch the difference faster. And these detail tells us that each technic serves best for different types of problems.

I’m still in the process of understanding DP and DC difference and I can’t say that I’ve fully grasped the concepts so far. But I hope this article will shed some extra light and help you to do another step of learning such valuable algorithm paradigms as dynamic programming and divide-and-conquer.

Full text and comments »

  • Vote: I like it
  • +12
  • Vote: I do not like it

By trekhleb, 6 years ago, In English

Hello Readers!

I've recently launched JavaScript Algorithms and Data Structures repository on GitHub with collection of classic algorithms and data-structures implemented in ES6 JavaScript with explanations and links to further readings and YouTube videos. There is also Algorithms and Data Structures YouTube playlist that contains all the videos mentioned in that repository so you may just go and take this hand-made online learning course :)

So I guess you've already grasp main idea of the project -  helping developers to learn and practice algorithms and do it in JavaScript .

Full text and comments »

  • Vote: I like it
  • +35
  • Vote: I do not like it