Re: [algogeeks] Amazon -> array problem

2011-09-29 Thread Ankur Garg
Is the array Sorted ? On Thu, Sep 29, 2011 at 4:56 PM, raju wrote: > Given an integer array. { 1,2,3,4,5 } > Compute array containing elements > 120,60,40,30,24 (2*3*4*5,1*3*4*5, 1*2*4*5, 1*2*3*5, 1*2*3*4) > > We shouldn't use division operator( / ) > Time complexity O(n) .. Space complexity O(

[algogeeks] Amazon Ques

2011-09-27 Thread Ankur Garg
Print Reverse of linked list (dont reverse it) with only constant space. Recursion uses stack spaceO(n) ..so post some other solution .. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegr

Re: [algogeeks] How to height balance a binary search tree ?

2011-09-27 Thread Ankur Garg
L , R ,LR , RL rotations On Tue, Sep 27, 2011 at 10:35 PM, sukran dhawan wrote: > avl tree > > > On Tue, Sep 27, 2011 at 10:15 PM, Ankuj Gupta wrote: > >> Given a bst how to height balance it ? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Ge

Re: [algogeeks] MS Question -> Median of a BST without using extra space and in O(n)

2011-09-27 Thread Ankur Garg
@Anshu Will u be using extra space to store ur nodes in traversal ? On Tue, Sep 27, 2011 at 2:22 PM, anshu mishra wrote: > do the inorder traversal as soon as reached at n/2th element that will be > median. > > -- > You received this message because you are subscribed to the Google Groups > "

[algogeeks] MS Question -> Median of a BST without using extra space and in O(n)

2011-09-27 Thread Ankur Garg
I was thinking of making the tree balanced with equal no of nodes in left and right subtree Median will be root in this case Regards Ankur -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googl

Re: [algogeeks] Re: MS question

2011-09-26 Thread Ankur Garg
< m; i++) > for (j = 1; j < n; j++) >if (M(i,0) || M(0,j)) M(i, j) = 1; > if (row0has1) > for (j = 0; j < n; j++) M(0,j) = 1; > if (col0has1) > for (i = 0; i < n; i++) M(i,0) = 1; > > Maybe there's a slicker way, but this is O(mn) > > On Sep 26,

Re: [algogeeks] Re: microsoft interview

2011-09-26 Thread Ankur Garg
@Teja Bala U dont need the last line for a[0][0] else code will be wrong conside 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 Regards On Sun, Sep 11, 2011 at 11:56 PM, teja bala wrote: > //pseudo code dis will work for sure. > > for(i=0;i for(j=0;j { > if (a[i][j] == 1) >

[algogeeks] MS question

2011-09-26 Thread Ankur Garg
Saw this question in one of the algo communities. Amazon telephonic interview question on Matrix Input is a matrix of size n x m of 0's and 1's. eg: 1 0 0 1 0 0 1 0 0 0 0 0 If a location has 1; make all the elements of that row and column = 1. eg 1 1 1 1 1 1 1 1 1 0 1 1 Solution should be with T

[algogeeks] Amazon Question

2011-09-25 Thread Ankur Garg
You are given 2 log files each having 1 billion entries and each entry has a unique customer id.You need to print the records in two files which are common. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to

Re: [algogeeks] Re: Amazon online test

2011-09-24 Thread Ankur Garg
Deoki nandan In MCQ there were options as well ?? is it ? Also were questions in MCQ only from coding or OOPS,DBMS,OS etc also are part of those ? Regards On Sat, Sep 24, 2011 at 6:13 PM, Aamir Khan wrote: > @shiv : Correct Answer should be : 5C3 X 5 X 4 X3 = 600 > > > > > > Aamir Khan |

Re: [algogeeks] Amazon Interview Question

2011-09-24 Thread Ankur Garg
void sort012(int a[],int n){ int i = 0, s = 0, last = n-1; while(i<=last){ if(a[i] == 0 && i!=s) { swap(a[i], a[s]); s++; } else if(a[i] == 2 && i!=last) { swap(a[i], a[last]); last--; } else i++; } } On Sat, Sep 24, 2011 at 5:13

Re: [algogeeks] Re: Questions on Graphs

2011-09-22 Thread Ankur Garg
B. > > Find the minimal spanning tree of a weighted, connected graph. > > On Sep 22, 2:03 pm, Ankur Garg wrote: > > Hi Frnds > > > > Can anybody suggest me some questions typically asked on Graphs . > > > > Couldnt find much in the internet > > >

[algogeeks] Questions on Graphs

2011-09-22 Thread Ankur Garg
Hi Frnds Can anybody suggest me some questions typically asked on Graphs . Couldnt find much in the internet If some one can share link or few questions on Graphs it will be really helpful Thanks in Advance Ankur -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] All valid dictionary words must be found and printed.

2011-09-19 Thread Ankur Garg
nice find bhanu..though i didnt get much :P on first read :D :D On Tue, Sep 20, 2011 at 4:34 AM, Bhanu Kishore wrote: > See this algorithm: > http://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm > > > -- > You received this message because you are subscribed to the Google G

Re: [algogeeks] Re: K-LCS

2011-09-19 Thread Ankur Garg
Yes...You cant use suffix trees here...Forget Coding...can anybody even explain the algo as to how suffix trees or tries can be used here ? On Tue, Sep 20, 2011 at 12:45 AM, pooja wrote: > exactly.. to implement suffix tree was out f my reach atleast during > the test. even thou i knew dat it

Re: [algogeeks] Re: Directi Questions - needed answers

2011-09-19 Thread Ankur Garg
Q9 - > 1 *logn for getting the minimum element ..Normal heap Sort procedure Q3 - > n+logn-2 comparisions so 51 -2 + log 51 Regards Ankur On Mon, Sep 19, 2011 at 7:59 PM, Ashima . wrote: > m getting result in 95 matches > > Ashima > M.Sc.(Tech)Information Systems > 4th year > BITS Pilani > R

Re: [algogeeks] Re: algorithm problem

2011-09-16 Thread Ankur Garg
Some typos in my solution :( Use a Max heap.. first take the first 10 stations and build a* Max *heap O(10)..Heap contains distance between 2 stations . Initial Heap will contain 10 *minimum *distances with maximum of those at the top . Now 11 th comes u compare with the root of the heap . If i

Re: [algogeeks] Re: algorithm problem

2011-09-16 Thread Ankur Garg
Use a Max heap.. first take the first 10 stations and build a min heap O(10)..Heap contains distance between 2 stations . Initial Heap will contain 10 min distances with highest at the top . Now 11 th comes u compare with the root of the heap . If its less than that than replace it with the top a

[algogeeks] Microsoft Question

2011-09-16 Thread Ankur Garg
In a matrix of characters, find an string. String can be in any way (all 8 neighbours to be considered) like find Microsoft in below matrix. A C P *R *C* *X *S **O *P *C* V *O* V N *I* W G *F **M *N Q A *T* I T *Any Ideas How to Solve/Approach this problem ?* -- You received this message becau

Re: [algogeeks] Re: Microsoft Question

2011-09-13 Thread Ankur Garg
have the greatest priority and the > element pushed first will have > lowest priority. > For queue:- keep decrementing the priority of each inserted element. > > On Sep 13, 1:45 am, Ankur Garg wrote: > > How to Implement a Queue with a Priority Queue > > Similarly how wo

[algogeeks] Microsoft Question

2011-09-12 Thread Ankur Garg
How to Implement a Queue with a Priority Queue Similarly how woud you implement Stack with Priority Queue -- 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 thi

Re: [algogeeks] Re: unique no. problem

2011-09-12 Thread Ankur Garg
^+1 On Mon, Sep 12, 2011 at 11:41 PM, Ankuj Gupta wrote: > Is there any restriction on the input like they are in given range ? > > On Sep 11, 11:10 pm, Neha Singh wrote: > > You are given an array that contains integers. The integers content is > such > > that every integer occurs 3 times in t

Fwd: [algogeeks] Re: MICROSOFT

2011-09-11 Thread Ankur Garg
If its a BST then the rightmost element will be the maximum followed by root and left node So we can use recursion Working Code struct node* findKthLargest(node* root, int& k) { if(root==NULL){ return NULL; } struct node* temp; temp=findKthLargest(root->right,k); k--; if(k==0)

Re: [algogeeks] Re: Amazon ques

2011-09-11 Thread Ankur Garg
r of intervals." > Assuming n means number of elements in the original array > There are O(n^2) possible intervals, how can you print them in O(n) ??? > > > On Sun, Sep 11, 2011 at 4:20 PM, Ankur Garg wrote: > >> This solution is not in O(n) time :( >> Unfortunately

Re: [algogeeks] Re: Amazon ques

2011-09-11 Thread Ankur Garg
This solution is not in O(n) time :( Unfortunately interviewer wants O(n) . On Sun, Sep 11, 2011 at 4:01 PM, Kunal Patil wrote: > @Brijesh: +1 > > > On Sun, Sep 11, 2011 at 2:14 PM, Brijesh wrote: > >> This is the fastest way I can think of to do this, and it is linear to >> the number of inter

[algogeeks] Amazon ques

2011-09-11 Thread Ankur Garg
given an array of size N containing only 0s and 1s return the length of the maximum sub array containing equal number of 0s and 1s Give a O(n) solution It has been asked before in this forum but no one has given a proper solution so m asking again May be we need DP here..But what will be the rec

Re: [algogeeks] pattern matching

2011-09-02 Thread Ankur Garg
Use KMP dude if u know it ...Who told not to use it ?? Dont read absurd things from net Regards Ankur On Sat, Sep 3, 2011 at 12:35 AM, Aman Kumar wrote: > Hiii > > Friends ,if pattern matching question is asked in the interview , we > should answer brute force(with some optimization) approach

[algogeeks] How to find median of 2 sorted arrays of different length

2011-09-01 Thread Ankur Garg
Can anybody explain logic ? -- 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 more optio

Re: [algogeeks] Find square root a number

2011-08-30 Thread Ankur Garg
@techcoder Making an array of 32768 or INT_MAX will make ur compiler cry Also ur case doesnt handle the scenario where square root is a decimal number On Tue, Aug 30, 2011 at 1:35 PM, tech coder wrote: > the sqrt of 32 bit number can't be more than 16 bits. > > have an array of 2^16 elemnts w

Re: [algogeeks] URGENT- Software engineers - Java / J2ee...Need LOCALS !!

2011-08-30 Thread Ankur Garg
Hi Tech Coder Didnt check the details :( ...thanks for your concern man!! Appreciate it Thanks Ankur On Tue, Aug 30, 2011 at 1:27 AM, tech coder wrote: > are u carzy replying such spams and putting ur resume on public forum > > > On Mon, Aug 29, 2011 at 12:52 PM, Ankur

Re: [algogeeks] URGENT- Software engineers - Java / J2ee...Need LOCALS !!

2011-08-29 Thread Ankur Garg
Hi PFA my resume for the below position Regards Ankur On Tue, Aug 30, 2011 at 1:00 AM, katie williams wrote: > *URGENT- Software engineers - Java / J2ee!! MAX $45/Hr...Need LOCALS (Face > to Face Required)* > > -After TS Second round of interviews will be F2F! This position is located > outside

Re: [algogeeks] Re: 2 Binary trees are isomorphic?

2011-08-28 Thread Ankur Garg
Daves solution looks cool to me...shud work :) Nice one Dave :) Regards Ankur On Sun, Aug 28, 2011 at 4:08 PM, Ankur Garg wrote: > cant we just count the no of nodes in each level and compare them with the > second one.. > > if the numbers are same trees can be said to be isomorp

Re: [algogeeks] Re: 2 Binary trees are isomorphic?

2011-08-28 Thread Ankur Garg
cant we just count the no of nodes in each level and compare them with the second one.. if the numbers are same trees can be said to be isomorphic On Sun, Aug 28, 2011 at 3:54 AM, Dave wrote: > @Bugaboo: Use recursion. Assuming > > struct tree_node { >tree_node *left; >tree_node *right;

[algogeeks] amazon ques :Online round

2011-08-25 Thread Ankur Garg
You are given n no. of lines in form of Ax + By = C, basically you are given A[i], b[i] and C[i] for line "i". Lines are given in a way such that 0 <= x[i] <= 1 and y[i] < y[i+1] for same X. Also, one point (x,y) is given too. Find out the two closest lines to the point such that the point is betwe

Re: [algogeeks] Re: Doublly link list

2011-08-24 Thread Ankur Garg
http://en.wikipedia.org/wiki/XOR_linked_list Check this...will be handy On Thu, Aug 25, 2011 at 2:12 AM, Mohit kumar lal wrote: > it might cause STACK OVERFLOW for larger size of lists. > > > On Thu, Aug 25, 2011 at 2:04 AM, Abhishek > wrote: > >> in brief, >> in the next pointer put the XOR va

Re: [algogeeks] Citrix C Question

2011-08-24 Thread Ankur Garg
; i think its error..l value required > > On Wed, Aug 24, 2011 at 11:18 PM, Ankur Garg wrote: > >> Hi >> >> Suppose there is a program >> >> int main(){ >> printf("%t",&main()); >>sleep(1000); >> return 0; >> } &

Re: [algogeeks] Remove all Duplicates Words

2011-08-24 Thread Ankur Garg
Both of these methods will require extra ,memory On Wed, Aug 24, 2011 at 9:42 PM, Anup Ghatage wrote: > How about this, > We compare the first character with every character except the characters > in the word itself, if there is a hit, it might be a word which is a > duplicate. > So from there

Re: [algogeeks] Re: MS Question

2011-08-24 Thread Ankur Garg
It means when u call that func u get the next word in the document Regards Ankur On Wed, Aug 24, 2011 at 6:59 PM, vikas wrote: > what do you mean by "a function for finding the next word is given" ? > > On Aug 22, 1:56 am, Ankur Garg wrote: > > Question-->

[algogeeks] Citrix C Question

2011-08-24 Thread Ankur Garg
Hi Suppose there is a program int main(){ printf("%t",&main()); sleep(1000); return 0; } The above program is run from 100 different windows What will be the output Will there be any pattern Regards Ankur -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: Find the non-duplicate element in sorted array in < O(n) time

2011-08-24 Thread Ankur Garg
Hi The ques explicitly said the elements are in pairs ...But the one given by sanjay has more than 2 2's ...that question cant be done using bsearch then On Wed, Aug 24, 2011 at 6:21 PM, Sanjay Rajpal wrote: > yes this is the only one till now, but i think we can do better also. > > Hope a bett

Re: [algogeeks] Mentor Graphics Help !!

2011-08-22 Thread Ankur Garg
Also to add, If you post profile in their portal no reply comes...How to apply ...can any one here refer my candidature for Mentor Graphics ..I have 2 yrs work ex working with IBM ISL Regards Ankur On Mon, Aug 22, 2011 at 7:23 PM, Mangal Dass wrote: > Anybody pls tell me the questions coming in

[algogeeks] Amazon Ques

2011-08-22 Thread Ankur Garg
Find the middle of the stack..(Time complexity should be minimum) Stack is not implemented as Linked List ...u have normal stack with push,pop and top How to do this ?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group,

[algogeeks] MS Question

2011-08-21 Thread Ankur Garg
Question--> Given a document containing some words ...and a function for finding the next word is given .design a code which efficiently search the word and find occurrence of it in given document . -which data structure will be used? -

Re: [algogeeks] Microsoft :)

2011-08-21 Thread Ankur Garg
@Harsha Bro I am unable to read ur blog ..It says this http://harshal-theone.blogspot.com/ It doesn't look like you have been invited to read this blog. If you think this is a mistake, you might want to contact the blog author and request an invitation. Is there anything I need to do to view th

[algogeeks] Can We Use STL like Vectors,Maps,Stack Queues to solve problems in Interviews

2011-08-20 Thread Ankur Garg
One of my frnds was saying its not recommended to be Used Please suggest -- 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 algogee

Re: [algogeeks] Amazon Question

2011-08-18 Thread Ankur Garg
Can u provide a bit detail bro !! On Thu, Aug 18, 2011 at 8:04 AM, sagar pareek wrote: > Hashing > :) > > On Thu, Aug 18, 2011 at 5:30 PM, Ankur Garg wrote: > >> Define a data structure , using extra memory/space , such that : >> >> Insert(int a) >> Delet

[algogeeks] Amazon Question

2011-08-18 Thread Ankur Garg
Define a data structure , using extra memory/space , such that : Insert(int a) Delete(int a) isPresent(int a) get(int a) All above operations on the defined data structure take O(1) , i.e. constant time. Any suggestions /solutions for this problem Regards Ankur -- You received this message

Re: [algogeeks] Re: Urgent...plz help

2011-08-18 Thread Ankur Garg
U can use selection Algorithm to achieve the same ...it has got expected running time complexity as O(n) ...Read Wikipedia to see the proper implementation.. Just some tweak with Quick Sort ..Also there is one method median of medians one which has worst case complexity as O(n) Regards Ankur On

[algogeeks] Can anybody provide source code or suggest how to write one for median of median algo

2011-08-17 Thread Ankur Garg
I found it a bit tough..Can anyone suggest code for it -- 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...@googl

[algogeeks] Possible solutions to these sort of Questions

2011-08-17 Thread Ankur Garg
Write test cases for WordPad,Notepad In general while writing test cases for problems what parameters should one Consider. MS has a habit of asking these sort of questions on a regular basis Please help as i cant think much on how to attack ques like these Regards Ankur -- You received this m

Re: [algogeeks] Re: How to solve this problem

2011-08-15 Thread Ankur Garg
ach of O(n), so the overall order will be O(n). > > On Aug 14, 10:08 am, Ankur Garg wrote: > > This is one question from Coreman > > > > 3rd Edition - > > > > 8-3-4 -- Sort n integers in the range 0 to n^3 -1 in O(n) time > > > > Any ideas how

Re: [algogeeks] Memory Leak

2011-08-14 Thread Ankur Garg
Where ever u have allocated dynamic memory that qualifies to be a culprit for causing memory leak ...Scan through the code if the memory block has been deallocated or not ... Regards Ankur On Sun, Aug 14, 2011 at 6:03 PM, SAMMM wrote: > How to detect in which line the Memory Leak has occured ?

[algogeeks] How to solve this problem

2011-08-14 Thread Ankur Garg
This is one question from Coreman 3rd Edition - 8-3-4 -- Sort n integers in the range 0 to n^3 -1 in O(n) time Any ideas how to do this in O(n) -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeek

Re: [algogeeks] Design .. how to attack ???

2011-08-12 Thread Ankur Garg
+1..me too need answers for this On Fri, Aug 12, 2011 at 11:39 AM, MAC wrote: > if someone can share one good solution , it would really help me. I am > unable to form the answer to these questions > > --mac > > > On Fri, Aug 12, 2011 at 1:15 PM, MAC wrote: > >> thanks guys .. so lets take t

Re: [algogeeks] Re: Amazon question.

2011-08-12 Thread Ankur Garg
@Dave How is the complexity O(n^2logn) .. Can you please tell I believe there cant be solution better than O(n^2) unless u use FFT which again is out of scope , at least for me :) Regards Ankur 2011/8/11 Samba Ganapavarapu > Can we find any alg. which runs faster than O(n^2) using these 2 axi

Re: [algogeeks] Re: Directi interview question

2011-08-08 Thread Ankur Garg
I can think of this solution Put first elements in a max heap ..O(10) Now take 11 th element ..compare it with root of this max heap ..If less than root ignore ..else remove root and call max-heapify and put this element in right place Similarly do this for rest Complexity will be n+nlogk wher

Re: [algogeeks] ThoghtWorks on campus

2011-08-08 Thread Ankur Garg
How much thought work pays..Can any1 tell ? On Mon, Aug 8, 2011 at 2:48 PM, vaibhav shukla wrote: > @raj : its about to come to our campus too..questions hv been uploaded > already in grp. Do send the questions which they ask please > > > > On Tue, Aug 9, 2011 at 12:09 AM, raj kumar wrote: > >>

Re: [algogeeks] constness in c++

2011-08-08 Thread Ankur Garg
In the code snippet that you have written u r changing the value of the variable d which has been defined as auto variable (int d) Now when u declare const int *const ptr = &d; that means both the ptr and int are constant and u cant change either so u cant deference ptr to some other int value h

Re: [algogeeks] Re: amazon online test format

2011-08-06 Thread Ankur Garg
@Yasir Thanks bro :) On Sat, Aug 6, 2011 at 7:13 PM, Yasir wrote: > Same as of DS & Algo in GATE exam. > http://geeksforgeeks.org/?cat=66 > > On Aug 7, 2:29 am, Ankur Garg wrote: > > @Yasir > > > > MCQ are of which types ???

Re: [algogeeks] Re: amazon online test format

2011-08-06 Thread Ankur Garg
@Yasir MCQ are of which types ??? Regards Ankur Garg On Sat, Aug 6, 2011 at 4:45 PM, Yasir wrote: > Earlier they had telephonic interview as first round but now this > online exam has become initial screening test. > Based on ur online test's performance they call for phon

Re: [algogeeks] Re: amazon online test format

2011-08-06 Thread Ankur Garg
The questions in the link are quite decent...Is the toughness level of Amazon test same or more ? On Sat, Aug 6, 2011 at 11:47 AM, shady wrote: > @nivedita this is for job right ? > > > On Sat, Aug 6, 2011 at 9:14 PM, nivedita arora < > vivaciousnived...@gmail.com> wrote: > >> no online test is

Re: [algogeeks] Why cant structures be declared or defined in C but can be done in C++ ?

2011-08-04 Thread Ankur Garg
inherit a structure from a class and vice-verse ... > > if u dont believe then just try it or google it... > > so as C is not object oriented hence we cant do things in it as we do in > C++ > > > On Fri, Aug 5, 2011 at 12:46 AM, Ankur Garg wrote: > >> sorry guys cud

Re: [algogeeks] Why cant structures be declared or defined in C but can be done in C++ ?

2011-08-04 Thread Ankur Garg
es can be declared.classes are not declared!!! > > > On Fri, Aug 5, 2011 at 12:13 AM, Dipankar Patro wrote: > >> Structures can very well be declared in C: >> struct student{ >> char name[20]; >> int roll; >> }s1; >> >> Are yo

[algogeeks] Why cant structures be declared or defined in C but can be done in C++ ?

2011-08-04 Thread Ankur Garg
Why cant structures be declared or defined in C but can be done in C++ ? What is the reason for this ? -- 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

Re: [algogeeks] Re: Give an efficient search algo

2011-08-03 Thread Ankur Garg
for 1 st question though it will give answer but not optimized one :) On Wed, Aug 3, 2011 at 4:02 PM, amit karmakar wrote: > I think for question 1, the value of k is not provided, right? > > On Aug 4, 12:53 am, Ankur Garg wrote: > > Dave's solution looks gud to me :) > >

Re: [algogeeks] Re: Give an efficient search algo

2011-08-03 Thread Ankur Garg
Dave's solution looks gud to me :) On Wed, Aug 3, 2011 at 3:52 PM, Ankur Garg wrote: > Q1 can be looked as rotated sorted array...check whether the no is less or > greater than kth element ..if greater search using binary search with low =0 > high k-1 and if less earch in righ

Re: [algogeeks] Re: Give an efficient search algo

2011-08-03 Thread Ankur Garg
Q1 can be looked as rotated sorted array...check whether the no is less or greater than kth element ..if greater search using binary search with low =0 high k-1 and if less earch in right with low=k+1 high =n; q2) Dont know :( On Wed, Aug 3, 2011 at 3:44 PM, Dave wrote: > @Tushar: For problem

[algogeeks] Oracle Interview ..Need Help!!

2011-08-03 Thread Ankur Garg
Hi All, Anyone who recently appeared for Oracle Interview . What all topics,subjects do they ask ? Regards Ankur -- 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 unsubscrib

Re: [algogeeks] latest google interview questions

2011-08-02 Thread Ankur Garg
Is this to tell people that U got an Intern at Google :P Another Wannabe here ...arg On Tue, Aug 2, 2011 at 5:17 PM, Anil Arya wrote: > I think the right answer is Balaguruswamy. > If am wrong ..Plzz correct me > > > On Wed, Aug 3, 2011 at 2:12 AM, sagar pareek wrote: > >> ha ha who is ritc

[algogeeks] Re: Myantra Iview

2011-07-30 Thread Ankur Garg
No one has it ? On Sat, Jul 30, 2011 at 7:52 PM, Ankur Garg wrote: > Has anybody given Myantra Iview recently > > I have an interview coming up > > Please share ques if you have > > Regards > Ankur > -- You received this message because you are subscribed to th

[algogeeks] Myantra Iview

2011-07-30 Thread Ankur Garg
Has anybody given Myantra Iview recently I have an interview coming up Please share ques if you have Regards Ankur -- 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 unsubscr

Re: [algogeeks] Facebook Interview question at NIT Warangal

2011-07-27 Thread Ankur Garg
Patil wrote: > >> @Ankur Garg: Nice explanation at the link given by u... >> >> >> On Tue, Jul 26, 2011 at 10:35 PM, Ankur Garg wrote: >> >>> Check this >>> >>> http://codesam.blogspot.com/2011/03/find-all-subsets-of-given-set.ht

Re: [algogeeks] Facebook Interview question at NIT Warangal

2011-07-26 Thread Ankur Garg
Check this http://codesam.blogspot.com/2011/03/find-all-subsets-of-given-set.html On Tue, Jul 26, 2011 at 9:41 PM, Vishal Thanki wrote: > Here is the working code.. > > #include > #include > int a[] = {1,2,3,4,5}; > #define ARRLEN(a) (sizeof(a)/sizeof(a[0])) > void print_comb(int len) > { >

Re: [algogeeks] Amazon Question

2011-07-26 Thread Ankur Garg
Hey Guys Can we use KMP Algorithm here to generate permutations...May be a bit modification is req On Tue, Jul 26, 2011 at 9:07 PM, keyan karthi wrote: > oops .. permutation pardon me guys !!! > > On 7/26/11, keyan karthi wrote: > > @kavitha: u can use back tracking to print all the subst

Re: [algogeeks] The Google Resume

2011-07-26 Thread Ankur Garg
+1 Me too looking out for the same :( On Tue, Jul 26, 2011 at 7:10 PM, Saravanan T wrote: > +1 > > Pls send to my email id as well.. > > > On Tue, Jul 26, 2011 at 7:09 PM, Akshata Sharma > wrote: > >> Anyone having the Google Resume book pdf? >> >> -- >> You received this message because you are

Re: [algogeeks] Facebook Interview question at NIT Warangal

2011-07-26 Thread Ankur Garg
Hi Dont u think the subsets will also be {2,1} {3,1} {3,2} {4,1} {4,2} {4,3} On Tue, Jul 26, 2011 at 11:59 AM, sumit wrote: > Given an array of size n, print all the possible subset of array of > size k. > eg:- > input: > a[]={1,2,3,4}, k = 2 > output: > 1,2 > 1,3 > 1,4 > 2,3 > 2,4 > 3,4 > > -

Re: [algogeeks] Patterns in a String

2011-07-25 Thread Ankur Garg
Use KMP algorithm On Mon, Jul 25, 2011 at 4:47 PM, nitesh wrote: > Given a string, give an algo to find the number of occurrences of a > particular pattern > > Eg: > > Input: "bellatbellfordbelly" > Find the number of occurrences of pattern(or substring) "bell" in it.. > > -- > You received this

Re: [algogeeks] Re: Prime Numbers

2011-07-24 Thread Ankur Garg
Do take a look at this also http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#cite_note-7 Source code to list all prime numbers till number n #include #include #define bool int using namespace std; int main(){ int n; cin>>n; int i,j; bool primeValues[1000]={0}; for(i=4;i<=n;i=i+2

Re: [algogeeks] Re: chronus corp..

2011-07-23 Thread Ankur Garg
http://chronus.com/ Is this the site of the company ? On Sat, Jul 23, 2011 at 3:45 PM, Ankur Garg wrote: > kool man ...Whr to apply for exp people ?? > > Can you share some link and all > > is company Chronos? > > > > > On Sat, Jul 23, 2011 at 3:33 PM, sush57 wr

Re: [algogeeks] Re: chronus corp..

2011-07-23 Thread Ankur Garg
kool man ...Whr to apply for exp people ?? Can you share some link and all is company Chronos? On Sat, Jul 23, 2011 at 3:33 PM, sush57 wrote: > fresher > > On Jul 23, 3:02 pm, Ankur Garg wrote: > > 9 for how much exp ?? > > > > On Sat, Jul 23, 2011 at 3:26

Re: [algogeeks] Re: chronus corp..

2011-07-23 Thread Ankur Garg
9 for how much exp ?? On Sat, Jul 23, 2011 at 3:26 PM, sush57 wrote: > 9... > > On Jul 23, 12:42 pm, sukhmeet singh wrote: > > Whats the CTC ??? > > > > On Sat, Jul 23, 2011 at 11:36 AM, sush57 wrote: > > > can anyone suggest interview questions for chronus corp...i have > > > interview on au

Re: [algogeeks] Re: MICROSOFT!!!!

2011-07-18 Thread Ankur Garg
post on 22nd itself bro ;) ..there is a written test on 23rd On Mon, Jul 18, 2011 at 8:45 PM, siva viknesh wrote: > @all..thanks a lotsure ll post the questions after 22nd :) > > On Jul 18, 8:13 pm, sourabh jakhar wrote: > > study basic well they give a lot of emphasis on them > >

<    1   2