Skip to content Skip to sidebar Skip to footer
Showing posts with the label Algorithm

Javascript: Check If An Array Is A Subsequence Of Another Array (write A Faster Naïve String Search Algo)

[5, 4, 4, 6].indexOfArray([4, 6]) // 2 ['foo', 'bar', 'baz'].indexOfArray([… Read more Javascript: Check If An Array Is A Subsequence Of Another Array (write A Faster Naïve String Search Algo)

Javascript - Generating Combinations From Dictionary Keys And Keeping Key Names Dynamically

I found this excellent code which generates all the combinations of multiple arrays here: JavaScrip… Read more Javascript - Generating Combinations From Dictionary Keys And Keeping Key Names Dynamically

How To Implement A Binary Trie That Has Nodes That Read 4 Bits At A Time?

I am trying to find a way to sort of inline a binary trie in some sense. Basically, a binary trie h… Read more How To Implement A Binary Trie That Has Nodes That Read 4 Bits At A Time?

How To Generate Two Different Random Numbers?

I need to generate two different random numbers, they can't be equal to each other or to a thir… Read more How To Generate Two Different Random Numbers?

How To Convert An Array Of Integers To A Tree?

Here is 100 numbers, 10 per row. [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, … Read more How To Convert An Array Of Integers To A Tree?

Calculate Distance To Move A Box To Remove Intersection

I have two boxes that are overlapping and I want to figure out how to move one to remove the inters… Read more Calculate Distance To Move A Box To Remove Intersection