I am trying to implement search algorithms in a 2D grid.
The problem I am facing is that let's say that I make a 2D grid in c++ through some array and also block some cells. Now how will I convert this grid into a binary tree to run search algorithm on it?
Any formula is applicable?

Why convert to binary tree? Is it even possible to convert from NxM grid to binary tree and keep the semantics of your 'grid'?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.