|
|
back to boardi can't understand BFS, what is it??? Posted by Bobur 25 Dec 2007 21:49 Re: i can't understand BFS, what is it??? Re: i can't understand BFS, what is it??? Let image graph where every number is vertex, then we can add edge from a to b if a+SQ=b (where SQ - some square). Now you can see graph, there maximum 60000 vertex and maximum ~ 60000*300 = 18 000 000 edges, out task is find way from 0 to given number. BFS will done this in O(N+M) Re: i can't understand BFS, what is it??? this task is easy to solve O(N) time ;) |
|
|