Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 1.36 KB

readme.md

File metadata and controls

23 lines (15 loc) · 1.36 KB

Project description

The project is regarding the solution of Sliding puzzle in which a player have to move the tiles in a grid to reach a solution state of continuous numbers in the grid.

puzzle

Goals

  • Printing the least number of moves to reach the solution state or printing not possible if there is no solution.
  • Printing the moves to make to reach the solution state in minimum number of moves.

Specifications

  • Driver.c is the main C language program which takes input from user and finds the the minimum number of moves.
  • list.c is the C file for adding the visited states of game to a singly linked list with a linear seach operation.
  • queue.c is the C file for queue data structure implemented using singly linked list with node of a queue containing information about the parent state.

Design

  • Used Breadth-first search(BFS) to explore all the states of game until a solution state is reached.
  • Used singly linked list to add the visited states of game.
  • Used a linked list based queue for BFS which also deals with parent state of a state to generate the path to the solution
  • Maintained the grid in from of string of digits.