Re: [algogeeks] Re: search in O(logn)

2012-06-09 Thread partha sarathi Mohanty
smthng like this... *if*(arr[mid] arr[mid + 1]) return mid; if(arr[low] arr[mid]) return findPoint(arr, low, mid-1); else return findPoint(arr, mid + 1, high); On Sat, Jun 9, 2012 at 12:36 AM, Hassan Monfared hmonfa...@gmail.comwrote: Hi pharta : find the point where

[algogeeks] Word printing Program

2012-06-09 Thread Navin Kumar
Write an efficient program that prints the distinct words in its input sorted into decreasing order of frequency of occurrence. Precede each word by its count. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the

[algogeeks] Re: Word printing Program

2012-06-09 Thread rammar
While you are reading words from the file, maintain a hash table. For each word encountered, update the hash count. Once the input file is exhausted, sort the hash table in O(logN) and print the list. A good hash function will be appreciated... else use the hash+=31*(*str) function and also

[algogeeks] Re: interview HARD problem

2012-06-09 Thread rammar
Is it necessary to have unique words, if i repeat same word horizontally and vertically then i end up with a square which is symmetric about its left diagonal. On Monday, June 4, 2012 6:34:11 PM UTC+5:30, ashgoel wrote: Given a dictionary of millions of words, give an algorithm to find the

[algogeeks] Re: Finding largest zigzag subsequence

2012-06-09 Thread rammar
Make an array with the differences i.e. diff[i] = list[i+1] - list[i] Iterate through the array diff and find out the sign changes. The total number of the sign changes will be the length of the largest sub-sequence which is zig-zag. Order: O(n) Space: O(n). On Friday, June 8, 2012 3:47:46

[algogeeks] Re: Basics--- Advanced

2012-06-09 Thread Decipher
I think you should start with DS in C by Tenanbaum. If you find it tough, then try some Indian DS books like DS in depth by Srivastva. After that you should try questions from Crack The Interview website or GeeksForGeeks tutorials and read advanced algos from : Introduction To

[algogeeks] Re: Word printing Program

2012-06-09 Thread Dave
@Navin: In Unix-speak, assuming one word per line in file f: sort f | uniq -c | sort -n -r I'm measuring efficiency by number of characters typed to implement the solution. Dave On Saturday, June 9, 2012 8:51:28 AM UTC-5, Navin Kumar wrote: Write an efficient program that prints the

[algogeeks] Basics of Cloud Computing

2012-06-09 Thread Ravi
Hi All, Hope you are all doing great. I am a cloud engineer and specialize in cloud computing development and architecting as well big data analysis. Check out my blog for my views @ http://www.cloudcer.com I have recently published my first book. Its' based on cloud computing basics for the

[algogeeks] [amazon]: dutch national flag algorithm

2012-06-09 Thread Navin Kumar
Given a character array as input. Array contains only three types of characters 'R', 'G' and 'B'. Sort the array such that all 'R's comes before 'G's and all 'G's comes before 'B's. Constraint :- No extra space allowed(except O(1) space like variables) and minimize the time complexity. You

Re: [algogeeks] [amazon]: dutch national flag algorithm

2012-06-09 Thread sanjay pandey
http://www.geeksforgeeks.org/archives/8133 -- 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.

Re: [algogeeks] MS Question : find word in 2D array

2012-06-09 Thread Bhaskar Kushwaha
@utsav u haven't initialized match anywhere so ur algo fails On Thu, Jun 7, 2012 at 2:50 AM, utsav sharma utsav.sharm...@gmail.comwrote: i think it can be solved using DP word=bcdf take hash of word h[b]=1 h[c]=2 h[d]=3 h[f]=4 given 2d matrix m[][]= {b c b e f g h b c d f p o u d f d