JanDW / slide-number-puzzle

The 15 puzzle is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. The goal of the puzzle is to place the tiles in order by making sliding moves that use the empty space.Note: not all shuffles are currently solvable.
https://jandw.github.io/slide-number-puzzle/
0 stars 0 forks source link

Experiments for inversionCount: BTS (binary tree search) & merge sort algorithms #15

Open JanDW opened 4 years ago

JanDW commented 4 years ago

Doesn't really make sense for an application like this one, but as an experiment it does.

try in experiments

Here's merge sort implementation: https://github.com/forallx-algorithms/inversions-count/blob/master/inversions_count.js

Some additional info: https://www.cp.eng.chula.ac.th/~prabhas//teaching/algo/algo2008/count-inv.htm

Also look at Grokking Algorithms