Re: [algogeeks] searching all matching words in a Trie with a given filter.

2013-05-30 Thread avinesh saini
Don, I'm trying to get all the words from trie iteratively, because I'm creating trie of whole dictionary (more than 200k words) and searching recursively will consume a lot of stack space. Thanks for your help! On Wed, May 29, 2013 at 9:44 AM, rahul sharma wrote: > > @don u r searching in a pre

Re: [algogeeks] searching all matching words in a Trie with a given filter.

2013-05-29 Thread rahul sharma
@don u r searching in a previously built trie with the given filter...then wat is this add fxn doing?correct me if m getting u wrng On Wednesday, May 29, 2013, avinesh saini wrote: > Thank you Don, I was also trying in similar way. But here I'm confused how you are storing the traversed words. Are

[algogeeks] searching all matching words in a Trie with a given filter.

2013-05-28 Thread avinesh saini
How to search all the matching words for a filter in a trie. e.g. searching by filter "...r..m" will find all the words(of length = 7) in trie in which 4th character is 'r' and 7th character is 'm'. -- * * *thanks & regards,* *Avinesh * -- You received this message because you are subscribed

Re: [algogeeks] Searching In a large file

2011-10-27 Thread Siddhartha Banerjee
read the question guys, only 2 mb of memory... i would perhaps try to find the range of the numbers... say the range is 300 million here... so i would maintain a count array, count[i]+=1 if on traversing the large file i find a number from chunk i, here chunk can be decided suitably, for example it

Re: [algogeeks] Searching In a large file

2011-10-27 Thread Anup Ghatage
I've been working on similar things lately. 1st, if the file is unsorted, you'll have to just go through it, it'll be O(n) worst case, which is preferred rather than sorting it. 2nd if it is sorted, read and store the maximum chunk of the file that you can, a program is allotted 4 GB of address s

Re: [algogeeks] Searching In a large file

2011-10-27 Thread Prem Krishna Chettri
Clearly this is an external sorting question.. Merge sort Can Be Used.. On 10/27/11, shiva@Algo wrote: > Given a file containing roughly 300 million social security > numbers(9-digit numbers), find a 9-digit number that is not in the file. > You have unlimited drive space but only 2megabytes of

[algogeeks] Searching In a large file

2011-10-27 Thread shiva@Algo
Given a file containing roughly 300 million social security numbers(9-digit numbers), find a 9-digit number that is not in the file. You have unlimited drive space but only 2megabytes of RAM at your disposal. -- You received this message because you are subscribed to the Google Groups "Algorithm

Re: [algogeeks] Searching Problems !!

2011-09-25 Thread veera reddy
Sol for Q1 http://www.geeksforgeeks.org/archives/1068 Sol for Q2 http://www.geeksforgeeks.org/archives/10768 On Sun, Sep 25, 2011 at 10:55 PM, Dheeraj Sharma < dheerajsharma1...@gmail.com> wrote: > it has some errors..lemme modify it > > On Sun, Sep 25, 2011 at 10:45 PM, Dhe

Re: [algogeeks] Searching Problems !!

2011-09-25 Thread Dheeraj Sharma
it has some errors..lemme modify it On Sun, Sep 25, 2011 at 10:45 PM, Dheeraj Sharma < dheerajsharma1...@gmail.com> wrote: > Q1 > int fun(int arr[],int left,int right,int num) > { > > int mid=(left+right)/2; > if(mid==0) > return 0; > if(mid==num-1) > return 1; > if( arr[m

Re: [algogeeks] Searching Problems !!

2011-09-25 Thread Dheeraj Sharma
Q1 int fun(int arr[],int left,int right,int num) { int mid=(left+right)/2; if(mid==0) return 0; if(mid==num-1) return 1; if( arr[mid]=arr[left]) return fun(arr,mid+1,right,num); else if(arr[mid]<=arr[left]) return fun(arr,left,mid-1,num); } fun(arr,0,size-1,si

Re: [algogeeks] Searching Problems !!

2011-09-25 Thread prasanth n
@ Decipher: Q1) find where the rotation begins and do binary search in the first half or the second half depending upon the search element On Sun, Sep 25, 2011 at 8:58 PM, Decipher wrote: > Q1) A sorted array is rotated unknown number of times , write an algorithm > to search an element in this

[algogeeks] Searching Problems !!

2011-09-25 Thread Decipher
Q1) A sorted array is rotated unknown number of times , write an algorithm to search an element in this rotated array in O(log n) . Hint : Modify binary search Q2) Write an algorithm to traverse a rectangular matrix spirally. -- You received this message because you are subscribed to the G

[algogeeks] searching a number in circular sorted array

2011-06-10 Thread coder dumca
hi frndz given an array which is circularly sorted like 6 ,7,8 ,1 ,2 ,3 ,4,5 search a given number. -- 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 unsub

Re: [algogeeks] searching

2011-02-14 Thread jalaj jaiswal
5 7 9 17 21 20 19 18 monotonic sequence consists of one increasing and 1 decreasing sequence so first lets find out pivot position .. can be done with modified binary search to find out two array first then applying binary search on both the arrays.. total O(logn) + O(logn1) +O(logn2) n>n1,n2 in

[algogeeks] searching

2011-02-14 Thread MONSIEUR
how will you search an element in a bitonic sequence Time complexity should be lessthan linear time -- 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

[algogeeks] Searching the Web

2009-05-19 Thread juniorm7
hi guys. Im trying to come up with an algorithm design for an agent that will search the web for prices of a stated product and return the least priced product. Any ideas or suggestions any1?? HOw would i search web sites given they wont always come in the same format?? Thanks --~--~-~-

[algogeeks] searching subsets problem

2006-09-11 Thread vijay
Lets say you have a given collection of subsets of a set of integers. Given a set of integers as input, what is the most efficient way to find out all the subsets in the collection of subsets which are also the subsets of the given set. A linear time solution is easy. I was wondering if there is