Re: [algogeeks] Number of paths

2013-02-22 Thread alexsolo
http://tafakuri.net/?p=66 def num_paths_to_grid_bottom(numRowCells, numColumnCells): currRow = [1 for x in range(numColumnCells + 1)] # the number of nodes to consider = numRowCells + 1 for numRow in range(1, numRowCells + 1): for numColumn in range(1,

[algogeeks] Re: Anagrams

2011-11-30 Thread alexsolo
Here is the python code for the similar problem: http://codercharts.com/puzzle/its-raining-anagrams The first command line parameter is dictionary file, the second is the file with checked words. The idea is to preprocess the dictionary in few steps: 1. calc the set of lengths of the checked

[algogeeks] Re: Any one

2011-11-27 Thread alexsolo
Here is the idea and the python code: http://stevehanov.ca/blog/index.php?id=114 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

[algogeeks] Re: Prime Numbers

2011-01-27 Thread alexsolo
#include stdio.h #include stdlib.h #include time.h #define MAX 15485863 #define LMT 100 unsigned flag[MAX6]; #define ifc(n) (flag[n6](1((n1)31))) #define isc(n) (flag[n6]|=(1((n1)31))) void sieve() { unsigned i, j, k; for(i=3; iLMT; i+=2) if(!ifc(i)) for(j=i*i,

[algogeeks] Re: nearest points

2011-01-22 Thread alexsolo
http://en.wikipedia.org/wiki/Kd-tree -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For

[algogeeks] Re: k nearest points

2010-12-06 Thread alexsolo
look here: http://en.wikipedia.org/wiki/Kd-tree -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to

[algogeeks] Re: FINDSR in spoj

2010-12-06 Thread alexsolo
http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to

[algogeeks] Re: k nearest points

2010-12-05 Thread alexsolo
use kd-tree -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this