How can i go about implemting 8/4 queens problem?Should i use DFS/BFS,I think DFs will be better. Can any one give some pseudocode/guidlines?
Use a stack and backtracking, easiest way is via recursion.
See these other SO posts:
Dumb 8 Queens problem in C++