You are here:

C/regarding data structures in C

Advertisement


Question
hello sir,
        This s rajbalaji.ur former student came thru veera sir..,
My question s tat hw 2 use stack concept in rate in a maze problem efficiently wich deals with data structures in C

Answer
Hai Dear Raj Balaji !

 Well i can remember you well .. How are ? how about your college ?

 Maze Problem was actually using the backtracking technique . ie . assume that a rat is running on a maze it randomly runs somewhere inside a maze once if the path was blocked obviously it will return back via the same way how it actually get into that place until it find some valid path !! this technique is called backtracking algorithm .

 This technique can be implemented efficiently with the help of stack . ie All the turns what you are making in a stack will be pushed inside a stack flags has been used to denote the direction of turn , once if your algorithm unable to proceed with the path then repeatedly pop out the previous positions from the stack and move back to the position and find if any path available , if available get through that path else repeat the pop operation and try to find the new path !

All the best !

Thanks and Regards !
Prince M. Premnath

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise


I'm sure that I can solve any doubts in Turbo C ,Graphics Programing ,Mouse, Hardware Programming ,File System ,Interrupts, BIOS handling , TSR Programming , General Concepts in C Language, handling inline Assembly statements

Experience

Research over 6+ Years

Organizations
CG-VAK Softwares and Exports Limited

Education/Credentials
Masters in Computer Applications

©2012 About.com, a part of The New York Times Company. All rights reserved.