Skip to main content

Problems

Knight's Tour Problem

The knight is placed on the first block of an empty board and, moving according to the rules of chess, must visit each square exactly once.

This is an example of Hamiltonian Path Problem. If the path's starting point and ending point must be the same, then this problem is Hamiltonian cycle problem.

  • The knight's tour puzzle is played on a chess board with a single chess piece, the knight.
  • The object of the puzzle is to find a sequence of moves that allow the knight to visit every square on the board exactly once.
  • Can be solved in linear time

Inorder Successor of BST

https://www.geeksforgeeks.org/inorder-successor-in-binary-search-tree

Word Ladder Problem

Problem - Given two words transform one word to another by changing only one letter at a time from the given list of words

Solution - Have a bucket for each class of words, in each bucket every word is connected to each other

Ex - POP_ which will match both POPE and POPS

https://www.freecodecamp.org/news/8-essential-graph-algorithms-in-javascript