[algogeeks] MS Question

2013-01-19 Thread Umer Farooq
Given a BST, how would you return the nth smallest element. The code had to cover all the edge cases and was expected to write a logn solution. -- Umer --

Re: [algogeeks] Re: Loan

2012-11-15 Thread Umer Farooq
If I were you, I would have tried to contact my parents, siblings, friends or people who knew me. But anyway, the embassy of your country can be helpful. On Tue, Nov 13, 2012 at 6:52 PM, saurabh arora wrote: > u contact indian embassy man..they will help u ,we are also poor with no > money!! > >

Re: [algogeeks] Time Complexity Analysis

2012-11-06 Thread Umer Farooq
Construct a simple binary tree out of the numbers mentioned and then max heapifying might help. Besides, a simple descending order sort will give us the same result. Most of the sorting algorithms take O(nLog(n)) time on average. On Tue, Nov 6, 2012 at 9:11 AM, atul anand wrote: > building tree

Re: [algogeeks] Re: swap objects without temp variable

2012-11-05 Thread Umer Farooq
But how is that going to work for objects? On Mon, Nov 5, 2012 at 6:43 AM, Ashok Varma wrote: > Try this: a = a + b - (b = a); //single line code to swap > > > > > On Mon, Nov 5, 2012 at 4:53 AM, Dave wrote: > >> @Manish: Sure. >> >> a = a + b; >> b = a - b; >> a = a - b; >> >> In 2-s complemen

Re: [algogeeks] finding element in array with minimum of comparing

2012-10-08 Thread Umer Farooq
n it will encounter a[-1]* > *i dont know if this loop will ever end... very poor solution i will say > * > > On Sat, Oct 6, 2012 at 10:00 PM, Umer Farooq wrote: > >> Well actually, I've just gone through Dave's code thoroughly and I >> believe that his code is

Re: [algogeeks] finding element in array with minimum of comparing

2012-10-06 Thread Umer Farooq
7;s code has it sitting in >> the variable temp for a little while. Loop will stop when size is 0, >> since arr[0]==elem. Now he throws temp back into arr[0], which will return >> index 0 from the last compare line. >> >> On Wednesday, October 3, 2012 2:08:56 AM UTC

Re: [algogeeks] finding element in array with minimum of comparing

2012-10-03 Thread Umer Farooq
, Oct 2, 2012 at 11:13 PM, atul anand wrote: > @umer : how no. of comparison are reduced to half by moving both > sidesyou have 2 if condition inside, so you are making 2 > comparisons at each iteration + n/2 comparison for while loop so > number of comparisons are n+n/2 > >

Re: [algogeeks] finding element in array with minimum of comparing

2012-10-02 Thread Umer Farooq
why don't we try it from both ends ... something like this: int i = 0; j = size-1; while (i != j) { if (arr[i] == elem) return arr[i]; if (arr[j] == elem) return arr[j]; } this way, we have eliminated half of the comparisons in for loop? What do you guys say? On Tue

Re: [algogeeks] Search an element in a sorted and pivoted array

2012-08-29 Thread Umer Farooq
Rahul, This might be helpful to you: http://www.geeksforgeeks.org/archives/1068 On Wed, Aug 29, 2012 at 12:29 PM, atul anand wrote: > just a random guess , i guess rahul is asking this :- > An array which has been rotated cockwise ( say k number of time) . find if > element X exists or not. > (

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-08-02 Thread Umer Farooq
A LinkedList is by itself is a BST such that one child node of each node is null. Do we need a simple BST or height balanced BST? On Tue, Jul 31, 2012 at 2:39 PM, Ashish Goel wrote: > how would you do "convert sorted doubly linked list to bst using same > nodes as in DLL" > Best Regards > Ashish

Re: [algogeeks]

2012-06-20 Thread Umer Farooq
;s equal distribution over the given range. >> >> On Tue, Jun 19, 2012 at 4:47 AM, Navin Kumar wrote: >> >>> @Umer: >>> >>> rand(5) + (rand(5)%2): => it will never give 6 because for rand(7) range >>> will be 0-6. >>> So bet

Re: [algogeeks]

2012-06-19 Thread Umer Farooq
mar wrote: > @Umer: > > rand(5) + (rand(5)%2): => it will never give 6 because for rand(7) range > will be 0-6. > So better try this: rand(5) + (rand(5)%3). > > > On Tue, Jun 19, 2012 at 2:45 PM, Umer Farooq wrote: > >> rand(5) + (rand(5)%2); >> >>

Re: [algogeeks]

2012-06-19 Thread Umer Farooq
rand(5) + (rand(5)%2); On Tue, Jun 19, 2012 at 12:30 PM, Sourabh Singh wrote: > @ sry > condition should be: > > if(20*prob <= 500/7) :-) > > > On Tue, Jun 19, 2012 at 12:26 AM, Sourabh Singh > wrote: > >> @ALL >> >> Given a random number generator say r(5) generates number between 1-5 >> unifor

Re: [algogeeks] If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2012-06-07 Thread Umer Farooq
cracking interviews is what Microsoft suggests. I'm not sure about the other one. On Thu, Jun 7, 2012 at 2:58 PM, sengar.mahi wrote: > http://users.ece.utexas.edu/~adnan/afi-samples.pdf > > is dis wat u al r lukin 4?? > > > On Thu, Jun 7, 2012 at 3:01 PM, Abhishek Sharma wrote: > >> yes,it is he

Re: [algogeeks] MS Q: how to test a driverless car?

2012-06-07 Thread Umer Farooq
What are the specs of the car. Can you please give the answer to the following clarifying questions: - How much distance is it suppose to travel without the driver? - Is it suppose to run on smooth roads only or can it also run on roads with jumps on it? On what type of road is the car most suitab

Re: [algogeeks] Code optimization.

2012-05-04 Thread Umer Farooq
t 10:26 PM, vIGNESH v wrote: > > Hai > > Can you brief about the rest of the cases? > > On 4 May 2012 01:56, Umer Farooq wrote: > >> Hi friends! >> >> I hope that you are doing really good these days. >> >> I submitted my code on interviewst

[algogeeks] Code optimization.

2012-05-04 Thread Umer Farooq
Hi friends! I hope that you are doing really good these days. I submitted my code on interviewstreet.com The problem statement can be found on https://www.interviewstreet.com/challenges/dashboard/#problem/4f1c739a6ea3a However, it passed for only two cases and gave a time out error for the rest

Re: [algogeeks] Re: find where the two list connect

2012-05-01 Thread Umer Farooq
You don't have to traverse the nodes of two lists simultaneously. You have to check if the every node of list one matches with the address of any node of list two. The first matching address will be the output. The worst case running time of this algo will be O(n^2) On Tue, May 1, 2012 at 8:47 P

[algogeeks] A sample question I got from interviewStreet

2012-04-27 Thread Umer Farooq
Hi everyone, I was just going through a sample question on interview street and I came across this question. Attached file contains the sample question. It is just an advanced version of towers of hannoi. However, the case00 are quite confusing. Can anyone please explain us how did they manage t

Re: [algogeeks] Google Question Invoice -bills

2012-03-26 Thread Umer Farooq
Well, they have specified in the question that "you are dealing with big-data sets". So, recursion won't be a good option I guess. Can we solve it with dynamic programming technique? On Mon, Mar 26, 2012 at 2:24 PM, atul anand wrote: > one way to do it , is say first combination for invoice 80=

Re: [algogeeks] Re: Microsoft Interview Question

2012-03-14 Thread Umer Farooq
t; the given link below or different? > > http://www.geeksforgeeks.org/archives/1155 > > > On Tue, Mar 13, 2012 at 11:31 AM, Umer Farooq wrote: > >> Yes that is exactly what they wanted. I proposed BFS for this solution. >> Anyway, there was another problem that I was a

Re: [algogeeks] Re: Microsoft Interview Question

2012-03-13 Thread Umer Farooq
pointer pointing to any random pointer in the list. The random pointer can be before or after the current pointer or it can even be at the same node. Write a piece of code that can produce an exact copy of the linked list. On Tue, Mar 13, 2012 at 10:57 AM, Umer Farooq wrote: > Yes that

Re: [algogeeks] Re: Microsoft Interview Question

2012-03-13 Thread Umer Farooq
and wrote: > > i guess they were talking abt spanning tree , so you can use prism or > > kruskal algo to do the same. > > > > > > > > > > > > > > > > On Mon, Mar 12, 2012 at 3:05 PM, Umer Farooq > wrote: > > > Hello frie

[algogeeks] Microsoft Interview Question

2012-03-12 Thread Umer Farooq
Hello friends, I recently had an onsite MS interview. One of the questions that they asked was: - Given a directed graph, write a program that takes root of the graph and returns root of a tree which comprises of all the nodes of the graph in the same way as they appeared in the graph (

Re: [algogeeks] thanx to all

2012-02-29 Thread Umer Farooq
congratz dude! :-) And best of luck with your future endeavours. On Wed, Feb 29, 2012 at 11:05 PM, Ravi Ranjan wrote: > @all > > 3 round liye > > 1.5 hours each only data structure n algorithm n 2 qstns from OS but > ultimately the code for synchronization(a mix situation of linked-list n > sem

Re: [algogeeks] algo qstn

2012-01-17 Thread Umer Farooq
0 On 1/16/12, Ravi Ranjan wrote: > An ant moves on a regular grid of squares that are coloured either black or > white. > The ant is always oriented in one of the cardinal directions (left, right, > up or down) and moves from square to adjacent square according to the > following rules: > - if it

Re: [algogeeks] rectangle of max sum MS Q

2012-01-16 Thread Umer Farooq
what about taking sum of the boundaries of the rectangle and omiting the boundary with least sum and including the rest of rectangle in the sub-set? On Mon, Jan 16, 2012 at 8:51 PM, atul anand wrote: > > find cumulative sum of each column. > now for each arr[x][y] = sum of arr[i=0 to x] [j] ; >

Re: [algogeeks] Re: MS Q

2012-01-15 Thread Umer Farooq
Here is my solution. Please have a look at it. Any kind of positive criticism will be highly appreciated. bool isConnected(int **space, int x, int y) { if (x == 0 && y == 0) { return false; } if (y > 0) { if (space[x][y-1] == 1) return true; } if (x > 0) { if (space[x-1][y] == 1) return true; } if

Re: [algogeeks] data structures for text editor

2012-01-14 Thread Umer Farooq
Are the number of words in one line fixed? On Sun, Jan 15, 2012 at 1:10 AM, uttam tiwari wrote: > what are the data structures that should be used to make a text editor > where we can perform following tasks: > 1. insert text > 2. search text > 3. delete text > 4. automatic line change(not mand

Re: [algogeeks] Re: MS Q

2012-01-10 Thread Umer Farooq
I still don't get how are they two islands. As long as I have understood, diagonals abridge the two islands into one. In this case, these two islands are connected so they form one single island? 1 1 0 0 1 1 0 0 0 0 1 1 This can be either one single island. Or they are three island if a change in

Re: [algogeeks] Testcases

2011-07-29 Thread Umer Farooq
Is that from a phone interview of MS? :-| On Fri, Jul 29, 2011 at 2:32 PM, Puneet Gautam wrote: > Hey everyone , pls tell me how testcases of following: > > 1. 3 sides of a triangle are taken, output whether its obstuse, > scalene,isosceles..? > 2. testcases of a duster... > > I know nothing abou

Re: [algogeeks] Re: FOR ALL INDIANS PLZ READ IT

2011-06-14 Thread Umer Farooq
+1 I really like this group ... but sometimes people get rude and show prejudice attitude towards me. I hope the admin takes notice of one of the comment posted above :) On Mon, Jun 13, 2011 at 12:30 AM, Divye Kapoor wrote: > While you're on this - could we have a policy that the first time > so

Re: [algogeeks] Re: FOR ALL INDIANS PLZ READ IT

2011-06-14 Thread Umer Farooq
Hi buddy, nominate me as a group member my id is: the.um...@gmail.com On Mon, Jun 13, 2011 at 12:03 AM, shady wrote: > Vishwakarma deok...@gmail.com > Arpit Sood soodfi...@gmail.com > > @kartik could have given your name had you read the post carefully. > > > Shady. > > > On Mon, Jun 13, 2011

Re: [algogeeks] FOR ALL INDIANS PLZ READ IT

2011-06-11 Thread Umer Farooq
Where is the admin of this group? These guys are discussing something completely irrelevant to Algorithms. Could anyone please take a notice of this in order to maintain the dignity of this group and filter the spam? On Fri, Jun 10, 2011 at 8:30 PM, coder dumca wrote: > so what ? supporting anna

Re: [algogeeks] Re: Divisibility by five

2011-05-07 Thread Umer Farooq
I'm surprised to see that why are you guys making this problem so complex. This problem can be solved in two steps only. 1- Convert the given int into string 2- Check if the last character is 0 or 5. // it yes, then return true else return false for e.g. 125 (last character is 5 ... therefore it

Re: [algogeeks] Divisibility by five

2011-05-03 Thread Umer Farooq
public static isDivisibleByFive(int input) { String str_input = String.valueof(input); // convert initial int to string. if ((str_input.charat(str_input.length()-1) == '5') || (str_input.charat(str_input.length()-1) == '0') // check if the last character is 0 or 5 return true; return false; }

Re: [algogeeks] Need the algorithm or idea

2011-05-03 Thread Umer Farooq
I have got a solution for this problem but It is greater than O(n^2). The idea is to take the edit distance with selected words from dictionary of all words in english and output the word with min edit distance (An edit distance is number of insertions, deletions and replacement operations needed

Re: [algogeeks] Re: If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2011-04-30 Thread Umer Farooq
please send it to me at "the.um...@gmail.com" Thanks in advance :) On Sat, Apr 30, 2011 at 8:41 AM, Manish Kumar wrote: > please send me this book to my email , thanks" manish.iitia...@gmail.com' > > > > On Sat, Apr 30, 2011 at 6:07 AM, Venkat wrote: > >> Hey how's ur interview? >> if u have th

Re: [algogeeks] Fwd: Problems

2011-04-29 Thread Umer Farooq
This is an assignment. Ryt? :P On Thu, Apr 28, 2011 at 1:31 PM, D.N.Vishwakarma@IITR wrote: > * > * > > > *Just give some time to these problems and solve it. Its sort of > Urgent.And Let me know the Solution. > * > > 1. Write an algorithm to implement a stack using a two dimensional > arra

[algogeeks] Re: [gcj] Regarding CJ onsite finals

2011-04-15 Thread Umer Farooq
Ok, thanks :) On Fri, Apr 15, 2011 at 6:19 AM, Hiep Q Dinh wrote: > > On Thu, Apr 14, 2011 at 6:11 PM, Umer Farooq wrote: > >> Last time, we attended qualifying round and round 1 from our homes (we >> didn't reach round 2 :p ). Anyway, is there anyone who can

Re: [algogeeks] ADULT SEX PHOTOS

2011-04-14 Thread Umer Farooq
Yeah, it is very embarrassing to see this kind of post on Algorithms group. On Thu, Apr 14, 2011 at 6:13 PM, ArPiT BhAtNaGaR < arpitbhatnagarm...@gmail.com> wrote: > yeah thats the soln > > > On Thu, Apr 14, 2011 at 6:12 PM, Kunal Patil wrote: > >> @All : Please report it spam and then delete. G

Re: [algogeeks] website feedback

2011-04-11 Thread Umer Farooq
nice idea! :) 2011/4/8 Seçkin Can Şahin > I developed a website/facebookapp. I would appreciate it if you could give > feedback about it. > > http://apps.facebook.com/wouldloveto/ > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To p

Re: [algogeeks] Interview Question

2011-04-11 Thread Umer Farooq
Ankur, you are rite. He mentioned that we may not know what the data might be. And yes, I agree that he kept the restriction because we may not know what the data is. In that case, I guess bit by bit copying of data from the next node to the current node (it is possible since both the nodes are of

Re: [algogeeks] Interview Question

2011-04-07 Thread Umer Farooq
mp ->next = ( temp -> next ) -> next . >> > if you are given a pointer to the second node do , >> > temp -> data = ( temp -> next ) -> data ; >> > temp -> next = NULL ; >> > >> > correct me if I am wrong . >> > >> >

Re: [algogeeks] Interview Question

2011-04-07 Thread Umer Farooq
; in case you are given a pointer to the first node simply do > temp ->next = ( temp -> next ) -> next . > if you are given a pointer to the second node do , > temp -> data = ( temp -> next ) -> data ; > temp -> next = NULL ; > > correct me if I am wrong

[algogeeks] Re: Interview Question

2011-04-07 Thread Umer Farooq
Anyone here who can answer this question? On Mon, Apr 4, 2011 at 9:18 PM, Umer Farooq wrote: > Hello friends, > > The following question has appeared in two top companies of my city. I'd > appreciate if anyone is able to answer it. > > Given a singly liked list co

Re: [algogeeks] Interview Question

2011-04-07 Thread Umer Farooq
t; > temp -> next = NULL ; > > > > correct me if I am wrong . > > > > On Mon, Apr 4, 2011 at 9:48 PM, Umer Farooq wrote: > > > >> Hello friends, > >> > >> The following question has appeared in two top companies of my city. I'd &

Re: [algogeeks] [brain teaser ] 6april

2011-04-06 Thread Umer Farooq
haha :) On Wed, Apr 6, 2011 at 4:12 PM, kunal srivastav wrote: > toughest puzzle ever :P > > > On Wed, Apr 6, 2011 at 1:27 PM, Akash Agrawal > wrote: > >> throw opposite to gravity... >> >> Regards, >> Akash Agrawal >> http://tech-queries.blogspot.com/ >> >> >> >> On Wed, Apr 6, 2011 at 1:26 PM,

Re: [algogeeks] i am new

2011-04-06 Thread Umer Farooq
This is a great group. Here, we share our knowledge and get to know a lot of new algorithmic techniques. On Wed, Apr 6, 2011 at 4:08 PM, Carl Barton wrote: > Yes > > > On 6 April 2011 11:36, a_SillyGuy wrote: > >> hi , >> i've recently joined this group in a mood to master the algorithms. >> Wil

Re: [algogeeks] Re:

2011-04-06 Thread Umer Farooq
hhahahahahahahhahaha Bohat aalaa sir! :D caught red-handed :D :P Ow please tell us the solution, I'm interested in knowing the answer :D On Sun, Apr 3, 2011 at 9:02 PM, Carl Barton wrote: > Haha > > > On 3 April 2011 15:28, Arpit Sood wrote: > >> assignment problem ? haha >> >> >> On Sun, Apr 3

Re: [algogeeks] Output of the code

2011-04-06 Thread Umer Farooq
ji a wrote: > the code will give error as there is nothing called "true" defined. > > On Sun, Mar 27, 2011 at 10:38 PM, Umer Farooq wrote: > >> Hi, >> >> Can anyone tell me the output of the following code? >> >> #include >> >> i

Re: [algogeeks] Output of the code

2011-04-06 Thread Umer Farooq
;> >>> >>> On Mon, Mar 28, 2011 at 8:42 PM, Praveen Kumar >>> wrote: >>> >>>> true is a keyword representing 1 and false as 0. The program will print >>>> the line a single time. >>>> >>>> On Mon, Mar 28,

[algogeeks] Interview Question

2011-04-06 Thread Umer Farooq
Hello friends, The following question has appeared in two top companies of my city. I'd appreciate if anyone is able to answer it. Given a singly liked list comprising of three nodes Delete the middle node such that: 1- A temp pointer is pointing to the first node 2- A temp pointer is pointing

Re: [algogeeks] Output of the code

2011-04-06 Thread Umer Farooq
btw, true is defined in cpp. On Mon, Mar 28, 2011 at 12:54 PM, Umer Farooq wrote: > The compiler doesn't want to get killed like poor > mani<http://www.allvoices.com/s/event-8408191/aHR0cDovL2JsYWNrY29icmEucG9zdGVyb3VzLmNvbS9leHRyZW1pc3QtaW5kaWEta2lsbHMtdGhlLXBvb3ItcGFyc

[algogeeks] Output of the code

2011-03-27 Thread Umer Farooq
Hi, Can anyone tell me the output of the following code? #include int main() { .. if (true) .. cout << "Pakistan will win the WorldCup 2011\n"; return 0; } -- Umer -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.

Re: [algogeeks] If any one have algorithms for interviews by adnan aziz ebook... Please mail ...

2011-03-26 Thread Umer Farooq
++ On Tue, Mar 22, 2011 at 9:39 PM, Saravanan T wrote: > ++ > > > On Tue, Mar 22, 2011 at 9:51 PM, Anurag atri wrote: > >> and me too :) >> >> >> On Tue, Mar 22, 2011 at 9:28 PM, Nikhil Mishra wrote: >> >>> count me too >>> >>> >>> On Tue, Mar 22, 2011 at 11:16 AM, kunal srivastav < >>> kunal.shr

Re: [algogeeks] Parallel algorithms

2011-03-01 Thread Umer Farooq
lel Programming > > Advanced and more theoretical > - Principles of Concurrent and Distributed Programming by M.Ben Ari > > On Fri, Feb 18, 2011 at 3:07 PM, Umer Farooq wrote: > >> Hello, >> >> Can anyone suggest me a good book for parallel algorithms? >> >>

[algogeeks] Parallel algorithms

2011-02-22 Thread Umer Farooq
Hello, Can anyone suggest me a good book for parallel algorithms? -- Umer -- 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 algog

Re: [algogeeks] Application of Data Structure

2011-02-22 Thread Umer Farooq
Hash. On Wed, Feb 16, 2011 at 9:45 PM, yv paramesh wrote: > build a tree > > On Wed, Feb 16, 2011 at 10:10 PM, vaibhav agrawal > wrote: > > Hash, SortedSet > > > > On Wed, Feb 16, 2011 at 9:58 PM, bittu > wrote: > >> > >> Given a set of words one after another, give a data structure so that >

Re: [algogeeks] UVA Online Submission.

2011-02-14 Thread Umer Farooq
gt; > Regards, > > On Wed, Feb 9, 2011 at 3:37 PM, Umer Farooq wrote: > >> Hello, >> >> I am new user of UVa website and I'm having problems in submitting the >> solution. Can anyone tell me >> >> 1- How do we take the input? via input file? command

[algogeeks] UVA Online Submission.

2011-02-12 Thread Umer Farooq
Hello, I am new user of UVa website and I'm having problems in submitting the solution. Can anyone tell me 1- How do we take the input? via input file? command line arguments? 2- How do we print the output? In an "output.txt" file? on Console? 3- Do we have insert the package statement? (if we ar

Re: [algogeeks] Regarding Google recruiting

2011-02-07 Thread Umer Farooq
Well, MS is way better in this regard. They talk so politely and take only a couple of weeks to send a message for further interview :-) On Sun, Feb 6, 2011 at 9:15 PM, shubham singh wrote: > i applied for intern and get reply within a month. > > -- > You received this message because you are su

[algogeeks] Regarding Google recruiting

2011-02-06 Thread Umer Farooq
Hello, I have applied for fresh grad posts in Google. I have filled up their forms and uploaded the resume. Can anyone tell me how long do they take to process the resume and how long should I wait? -- Umer -- You received this message because you are subscribed to the Google Groups "Algorith

Re: [algogeeks] Re: Invitation for CodeCracker'11 , Online Coding Competition

2011-02-03 Thread Umer Farooq
How am I suppose to provide inputs? Input file names?? On Wed, Feb 2, 2011 at 1:25 PM, Nikhil Agarwal wrote: > > > On Tue, Feb 1, 2011 at 7:42 PM, Umer Farooq wrote: > >> Hello, >> >> it's really nice to see such a world wide online programming competition &g

Re: [algogeeks] Re: Invitation for CodeCracker'11 , Online Coding Competition

2011-02-03 Thread Umer Farooq
Dude! There must be something wrong with your compilers!! It isn't even accepting a hello world program. it's giving a compilation error on that as well :-/ On Wed, Feb 2, 2011 at 9:49 PM, Umer Farooq wrote: > How am I suppose to provide inputs? Input file names?? > > >

Re: [algogeeks] Re: Invitation for CodeCracker'11 , Online Coding Competition

2011-02-02 Thread Umer Farooq
Hello, it's really nice to see such a world wide online programming competition being organized after Google CJ. I have got a three questions 1- Can we use Dev C++ (which we have been using on windows platform). If we are allowed to use dev C++, then do we have to submit .cpp files only or .cpp

Re: [algogeeks] Microsoft Written Test Questions

2011-01-27 Thread Umer Farooq
Hi there, can you share some of the Microsoft phone interview questions.? On Thu, Jan 27, 2011 at 6:47 AM, Ankit Babbar wrote: > Hey all...Can anyone provide me with the recent (/most common) written test > questions(or links ) of Microsoft IDC and Microsoft IT SDE positions...?? > > Thanks in ad

Re: [algogeeks] Symmetric matrix

2011-01-21 Thread Umer Farooq
We can also use jagged arrays for this purpose int[][] symmetric_matrix = new int[size][]; for (int i=0; i < size; i++) ...symmetric_matrix[i]=new int[max_diagonal/(size)]; On Wed, Jan 12, 2011 at 9:30 AM, Sathaiah Dontula wrote: > 1 + 2 + + n ( max diagonal) = n ( n + 1) / 2. > Max

Re: [algogeeks] Symmetric matrix

2011-01-13 Thread Umer Farooq
Well, u can use List of Lists. The List would contain head nodes of all the lists and each list would contain a row. The length of every list will be 1 greater than the next of it's next list. In this way: The tail of list would contain a diagonal element which L L1 1 L2 4 2 L3 4 3

Re: [algogeeks] Google Interview Question

2011-01-05 Thread Umer Farooq
There might be some error in calculating the value of some variable(s) which might be used to retrieve elements in some arrays/maintaining stack/linked list or any other data structure that uses the value of that variable to retrieve information from memory. Carefully checking the values of variab

Re: [algogeeks] Fwd: [ƒƒÖ]™ HaPpY NeW YeAr 2011

2011-01-01 Thread Umer Farooq
Thanks for the wishes. Same to you guys too. May this year bring happiness and prosperity into your lives. On Sat, Jan 1, 2011 at 2:27 PM, sudhir mishra wrote: > thank u,wish u the same > > > -- > * > Thanks & Regards... > Sudhir Mishra > undergraduate student, > Department Of **Computer Science

Re: [algogeeks] extendede hanoi problem

2010-12-31 Thread Umer Farooq
Can you elaborate the problem a little more? It has been stated in vague manner. On Fri, Dec 31, 2010 at 10:39 AM, sara wrote: > I Should Write A Recursive Program Of Extended Hanoi Tower. We Have > A,B,C Like Before But There Is 2n Button. Odd Buttons In A And Even > Buttons In B. For Example I

Re: [algogeeks] recursion to remove duplicate characters in a string

2010-09-19 Thread Umer Farooq
creating a bst would require extra space. You can do this with an array of char dude. On Sun, Sep 19, 2010 at 3:31 PM, LG JAYARAM . wrote: > hi buddy ...Im clear with the ideahereby I share the concept... > > wat exactly need to be done to solve this task isbetter create a Binary > searc

Re: [algogeeks] recursion to remove duplicate characters in a string

2010-09-18 Thread Umer Farooq
btw, if u rn't suppose to use any extra space, then u should be going for iterative solution; since recursion uses extra space by default. On Sat, Sep 18, 2010 at 11:33 PM, Umer Farooq wrote: > here's the java implementation > > package removeduplicate

Re: [algogeeks] recursion to remove duplicate characters in a string

2010-09-18 Thread Umer Farooq
here's the java implementation package removeduplicates; import java.io.*; /** * * @author UmerFarooq */ public class Main { /** * @param args the command line arguments */ public static char[] input; public static void remDep(int i, int j) { if (j<0)

[algogeeks] Graham scan

2010-04-03 Thread Umer Farooq
Can anyone explain me how graham scan algorithm for finding the convex hull works ? -- 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

Re: [algogeeks] Implementation of Algorithms

2010-03-31 Thread Umer Farooq
How much time to u have? If you have got more than a month and u don't know any language; then I'll suggest you to learn a programming language like C++ or Java. In my opinion, C++ is the best language for these kind of problems :) Regards Umer. On Wed, Mar 31, 2010 at 5:12 PM, naga vinod kumar

Re: [algogeeks] Finding the middle of a singly linked list which has a cycle in it

2010-03-29 Thread Umer Farooq
LL and it has cycle. Both N1 and N2 will keep > traversing within the cycle. > > > > On Sun, Mar 28, 2010 at 9:56 PM, Umer Farooq wrote: > >> I'll appreciate comments on the solution proposed by me. It works the >> following way: >> >> take two poin

Re: [algogeeks] how to convert a BST into a sorted doubly linked list.

2010-03-28 Thread Umer Farooq
insert the elements in the list, the elements of the tree visited by inorder traversal On Sun, Mar 28, 2010 at 11:13 AM, Piyush Verma <114piy...@gmail.com> wrote: > how to convert a BST into a sorted doubly linked list. > is there any solution of this question. > > -- > You received this message

Re: [algogeeks] Finding the middle of a singly linked list which has a cycle in it

2010-03-28 Thread Umer Farooq
g to the middle element of the list. Regards Umer Farooq On Sun, Mar 28, 2010 at 2:17 PM, Mukesh Kumar thakur < mukeshraj8...@gmail.com> wrote: > hi! in my opinion we can find the middle element in the singly linked which > hv the cycle > as we know the list doesnt support the

Re: [algogeeks] Finding the middle of a singly linked list which has a cycle in it

2010-03-27 Thread Umer Farooq
Node * N1, N2 = head do { . N1 = N1->NextPtr; ..N2 = N2->NextPtr->NextPtr; }while ((N2 != head)&&(N2->NextPtr != head)) return N1; I think the above algorithm will work fine. N1 will be the middle element at the end. On Sun, Mar 28, 2010 at 4:53 AM, mukunda n s wrote: > Simplification

[algogeeks] Convex hull

2010-03-26 Thread Umer Farooq
Given a set of points, how can i find the convex hull in O(nlog(n)) ? -- 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+un

Re: [algogeeks] You have to count the occurances of all words in a document. You are given a method chat * GetNextWord, that returns the next word from the document.

2010-03-05 Thread Umer Farooq
Thanks for lettimg me know that. Although I have used this kinda thingy in solving a lot of problems; but, I never knew that it is called a trie. On Thu, Mar 4, 2010 at 8:08 PM, Chakravarthi Muppalla wrote: > @Umer > 'categorize the words into 26 categories depending on the initial > character',

Re: [algogeeks] You have to count the occurances of all words in a document. You are given a method chat * GetNextWord, that returns the next word from the document.

2010-03-04 Thread Umer Farooq
I can't get how will u manipulate the trie DS. u'll have to look back and see if the word already exists in the list. this will be an extra overhead. I have thought of another algorithm. Here is an abstract explanation: The node used will be like this struct Word { .char *_word; .