Re: [algogeeks] Digest for algogeeks@googlegroups.com - 3 updates in 1 topic

2014-12-15 Thread Vikas Rastogi
another one could be some sort of hashing logic modulo n. Get request, create hash , compute modulo n. check assign cache and return. This will make sure of even distribution but with additional cost of hash computation. Regards, Vikash 8121873513 On Sun, Dec 14, 2014 at 5:07 PM, wrote: > >

[algogeeks] Re: Comparing string of unequal length

2014-10-07 Thread vikas
question unclear ?What is to be minimize ? in given example: ca*d*bch abc what is role of "d" ? On Monday, 6 October 2014 22:52:10 UTC+5:30, Rishav wrote: > > Hi everyone, > > I was asked this question recently in an interview: Given two strings of > unequal length, you have to pad the smalle

[algogeeks] Re: What is the algorithm for this problem

2014-07-02 Thread vikas
ion with the smallest score. Then based on the answer, remove any > orders from the list which are not consistent with that answer. Repeat the > process until you have only one order remaining. > Don > > On Tuesday, July 1, 2014 12:15:14 PM UTC-4, vikas wrote: >> >>

[algogeeks] What is the algorithm for this problem

2014-07-01 Thread vikas
One of my friend posted this question to me and I am unable to get anywhere. Could you guys please help A game of cards has 5 colors and 5 values. Thus a total of 25 cards are possible. Player 1 will choose n cards and tell you exactly , what all cards he has. Then he will spread cards in fron

[algogeeks] Re: changing structure of binary tree based on gravity and node selected.

2014-01-16 Thread vikas
it will all collapse and form a single monolithic straight line with bunch of balls hanging in between :D On Wednesday, 15 January 2014 10:47:47 UTC+5:30, atul007 wrote: > > Imagine a binary tree lying on the floor with nodes as balls and edges > as threads, you are given a pointer to a node. Wh

[algogeeks] Re: Loan

2012-11-13 Thread vikas
you should contact Indian Embassy, they will help you out. On Tuesday, 13 November 2012 15:02:39 UTC+5:30, Virag wrote: > > Hello, I hope this e-mail reaches well. Just to let you know that I'm > presently in Spain for an Agricultural Conference but I'm in a serious fix; > I was mugged and lost

[algogeeks] Re: T1, with millions of nodes, and T2, with hundreds of nodes. Create an algorithm to decide if T2 is a subtree of T1.

2012-10-28 Thread vikas
with all values equal > 42 except the rightmost node which is 43, these approaches will take a > very long time. Any ideas on how to improve performance in such cases? > Don > > On Oct 25, 3:09 am, vikas wrote: > > How about this > > > > Stack st; > >

[algogeeks] Re: T1, with millions of nodes, and T2, with hundreds of nodes. Create an algorithm to decide if T2 is a subtree of T1.

2012-10-25 Thread vikas
How about this Stack st; CheckSubtree(tree *bigTree, tree *smallTree) { if(bigTree == NULL) return; if(bigTree->data == smallTree->data) st.Push(bigTree); CheckSubtree(bigTree->left, smallTree); CheckSubtree(bigTree->right, smallTree) } bool compareSubtrees(tree* t1, tree* t2) {

Re: [algogeeks] C output

2012-10-17 Thread Vikas Kumar
gthOfString +1 ( +1 for '\0') strlen(anyString) = simple length sizeof(anyArray) = numberofElementPresentInArray*sizeof(dataType) -- *Thanks,* *Vikas Kumar* * * -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group

[algogeeks] Re: microsoft_c++_qstn

2012-10-01 Thread vikas
not sure what interviewer meant here, does not look like compiler dependent code, and BTW, last recurrence yield "5" :) and not 8, one possible def is, you have a function with no return and compiler is independent for choosing what to return in this case, just a guess. Not sure about cpp stand

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

2012-10-01 Thread vikas
still there is no improvement, compiler will generate the code to compare with zero here. what you have accomplished is , hide it from human eyes On Monday, 1 October 2012 15:25:09 UTC+5:30, Navin Kumar wrote: > > @atul: > still it won't compare 0 th element. Slight modification in your code: >

[algogeeks] [Google question]

2012-08-01 Thread vikas rai
There is a set of 9 students and 3 schools Every school can be alloted atmax 3 students .Every school and student has its coordinates .Now we have to allot student in such a way that the sum of distance from all the student to the school should be minimum. We have to solve this in less than O(n^3)

Re: [algogeeks] C o/p

2012-07-10 Thread vikas
he is right. On Tue, Jul 10, 2012 at 3:13 PM, rahul sharma wrote: > yeahu r ryt > > > On Tue, Jul 10, 2012 at 10:01 AM, Firoz Khursheed < > firozkhursh...@gmail.com> wrote: > >> Well, when i compiled the code the output ie i is alway i=2, >> >> http://ideone.com/AFljo >> http://ideone.com/87w

[algogeeks] Please help in understanding this question. I have no answers just this question.

2012-06-30 Thread Vikas
Given matrix(screen black n white)..where 1 represents black dot and 0=white. there can b many images/objects in it..return list of coordinates for each obkect..(Hint do BFS) -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this dis

[algogeeks] Help needed for telephonic interview from Amazon banglore.

2012-06-30 Thread Vikas
Hi I have one year experience and have interview scheduled on monday. Pease help me with your experience or knowledge regarding questions, strategy and any misc aspect. Thanks in advance -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To v

[algogeeks] Re: Facebook qsrtn

2012-05-03 Thread vikas
couldn't understand the question ?? so we have been given a combination and ranking set and set of cards ? now if every time any one picks up 3/5/7, rating must be higher. seems like a lot of randomness here. Do we need to rearrange the cards. and how user is going to pickup the card , from top, r

[algogeeks] Re: Adobe Noida Interview Question

2012-04-30 Thread vikas
1) you cannot escape but exhaustive search, trying all possibilities 2) basically you are asked to find string in stream, just try to do similar of Boyce-Moore , seems good for this problem. On Mar 30, 8:47 pm, Decipher wrote: > This was asked from my friend in January for MTS profile. > > Q1) G

[algogeeks] Re: determine if a string if of form pZq

2012-04-20 Thread vikas
couldn't understand the question :( On Apr 19, 1:32 pm, tech coder wrote: > determine whether the given string is of form pZq. > p and q can contain only X and Y. > like if p=XXYX then z will be XYXX > for ex  XXYXXXYXX   is valid > > the limitation is that "you can read only the next character  

[algogeeks] Re: GPU doubt

2012-04-09 Thread vikas
Hey Arun, IIya, the GPUs are faster because of 1. designed for graphics processing, which involves a lot of matrix processing capabilities , simple example transformation of matrices in to various view (projection, model and viewport , some times needed even in real time) so these computation a

[algogeeks] Re: Vertical Sum in a given Binary Tree

2012-03-19 Thread vikas
verticalSum( node * &root, List * &sum) { if(root == null) return; sum->data += root->data; verticalSum(root->left, sum->left); verticalSum(root->right, sum->right); } 1 / \ 2 3 / \/ \ 4 5 6 7 a b c d e Vsum(1, c) c= 1 V

[algogeeks] Re: Dynamic programming question

2011-12-13 Thread vikas
Graph take up, right and bottom as nodes connected to current and do find max path. On Dec 13, 3:44 pm, Azhar Hussain wrote: >   We have apples arranged in a mxn matrix. We start from the upper left > corner and have to reach bottom right corner with maximum apples. We can > only move either dow

[algogeeks] Re: smallest segment in a document containing all the given words

2011-12-02 Thread vikas
parse the document for the words and maintain a position table position table should be like this: w1-> p1 p2 p3pn w2->x1 x2 x3 xn k lists O(n) if hashing is used now go to begining of list and findout the maximum position say 'start' O(k) similarly from end of all list , check for th

[algogeeks] Re: Any one

2011-11-27 Thread vikas
break; } } } if(!found) print "no word matches with dict"; return; } printBackTrack(hashMap map, string key) { char* val = map.value(key); if(!val) return; printBackTrack(map, val); print "val"; } On Nov 26, 8:47 pm, tech coder

[algogeeks] Re: OPengl implementation of dijiktras algorithm

2011-11-26 Thread vikas
opengl is graphics spec , what hell it has to do with dijkstra ? On Nov 26, 1:49 pm, naveen ms wrote: > hi all >      Any one has the OPengl implementation of dijiktras algorithm.or > any idea how to implement it.. > > With regards > Naveen -- You received this message because you are subscribe

[algogeeks] Re: Maximize Subsquare

2011-11-26 Thread vikas
allOnes(row, column, len) so allone(i, 0, k) will check if A[i][0] to A[i][k] has all the ones similarly another allone should check for all column values. so algo is "if you come across any i, j which is '1' , then check for sq ending at i-1, j-1 and all the borders , if all are ones, store the l

[algogeeks] Re: Any one

2011-11-26 Thread vikas
this is well known problem, use the BFS traversal / Backtracking On Nov 26, 3:54 pm, tech coder wrote: > i think edit distance algorithm can not be used here because in edit > distance problem we have a target string and a source string. Here we dont > have any target word. > I think trie can be

[algogeeks] Re: Find the Minimum length Unsorted Subarray, sorting which makes the complete array sorted

2011-11-24 Thread vikas
char arr[] = {'a', 'b', 'e', 'f', 'd', 'g', 'h', 'i'}; calculate the point where array is not sorted , in this case arr[4] = 'd' calulate k in array[5..n] such that k > 4 arr[k] < d , take the min = min{ arr[k] } same thing for max from reverse use quick /selection sort to identify the correct in

[algogeeks] Re: an os question

2011-11-13 Thread vikas
that is normal in embedded systems, what you should do is , put the logs in the particular module, which can be enabled by choice. Another option is to store the stack traces. using such techniques , you will be able to find the problem, at least you will be able to reach near to it. On Nov 13, 2:

[algogeeks] Re: Amazon Question

2011-11-12 Thread vikas
seems like quesion of permutation, it will take all the permutation to check which one can lead to answer, there will be always be more than one solution complexity ((n-1)!) anyone for better solution ?? On Nov 12, 4:27 pm, surender sanke wrote: > @myself > > if number of distinct characters ar

[algogeeks] Re: free() function

2011-11-11 Thread vikas
nopes , they are not connected, it is just a chance you are getting the same values and nothing is overwritten there: basically these are DANGLING POINTERS . Now you should keep practising something like this #define FREE(N) { free(N); N=NULL;} to avoid such mistakes On Nov 11, 3:41 pm, shady w

[algogeeks] Re: Median of 2D matrix

2011-11-08 Thread vikas
you explain how a heap helps get the answer?  Just to put the > elements in a heap requires O ( N^2 log (N) ) time. > > On Nov 7, 4:12 pm, vikas wrote: > > > I think the best we can have is nlogn solution with the heap approach. > > > On Nov 6, 10:27 pm, Dave wrote: > >

[algogeeks] Re: coding round question

2011-11-07 Thread vikas
@Vikas, I think the brute force here will be combinatorial , you need to calculate all the combinations of lucky say 4, 7, 47, 74 and then try to find all of the moves combination which maximize this lucky array index, may be from last to first, just for little optimization. A bit tough

[algogeeks] Re: Mystery Of Extra bytes

2011-11-07 Thread vikas
byte stuffing On Nov 2, 2:17 am, SAMMM wrote: > As we all know that the new and delete operator , they are inherited > and tell call constructor and destructor respectively . Now Suppose I > have One Integer variable for the base class and one more Integer > variable for the derived class . So if

[algogeeks] Re: Maximize Subsquare

2011-11-07 Thread vikas
try this: sq(i, j)= k is maximum sqare possible ending at i, j and has length k in the matrix iXj sq(i, j) = k if {sq( i -1, j-1) && AllOnes(i,0, k) && AllOnes(0, j, k)} = 1 if sq(i, j) == 1 = 0 otherwise

[algogeeks] Re: Binary tree to BST

2011-11-07 Thread vikas
@ Above no need to have another array or nything binTreeToBST(node *root) { if(!root )return; node *newRoot; binTreeToBSTConv(root, &newRoot); } binTreeToBSTConv(node *old, node *new) { if(!old ) return; binTreeToBSTConv(old->left, new); binTreeToBSTConv(old->r

[algogeeks] Re: Questions

2011-11-07 Thread vikas
, I did not get your idea of reducing complexity , can you describe it in detail ? On Nov 4, 8:41 am, surender sanke wrote: > @vikas > > ur algo will search for 1st element of 1d in whole 2d array, > on worst case u'll search it in n^2, then search for all 1d elements > in 2

[algogeeks] Re: Median of 2D matrix

2011-11-07 Thread vikas
I think the best we can have is nlogn solution with the heap approach. On Nov 6, 10:27 pm, Dave wrote: > @Mohit: Here is a counterexample: > > 10      11        52      53      54 > 20      21      112     113     114 > 30      31      122     123     124 > 40      41      132     133     134 >

[algogeeks] Re: Questions

2011-11-01 Thread vikas
array :: > > 1  2  3   4    5    6 > 7   8  9  10 11 12 > 13 14 15 16 17 18 > 19 20 21 22 23 24 > > we hav 1d array as :-- 13 2 21 10 23 12 > > So the 1d array is a subset of 2d array ... > > On 11/1/11, vikas wrote: > > > > > what do you mean by subs

[algogeeks] Re: Questions

2011-11-01 Thread vikas
what do you mean by subset of 1D present in the 2D array? is it something like 3245 , the search may be 3245/ 24/ 45/ all 16 subsets need to be searched? On Oct 28, 12:02 pm, SAMMM wrote: > How do u plan to implement it ??? -- You received this message because you are subscribed to the Goo

[algogeeks] Re: coding round question

2011-10-30 Thread vikas kumar
The question was from startup company verego (may be misspelled), you understood it in correct way. We are given 'k' number of ranges in the fashion L, R they are all integers in big ranges , (assume long long for the case) then we are given move operation defined as move( i, +1/-1) : so range

[algogeeks] coding round question

2011-10-30 Thread vikas kumar
There are a number of integer ranges say [ L, R]i denoting left and right of segment i, lets says we are given K such segments and we define one operation as move which makes our chosen segment to move either +1 or -1 so after move(i, +1) segment i will be [L+1, R+1]. There are some particular num

[algogeeks] Re: Bit Magic ....Always Stuck ..

2011-10-16 Thread vikas
for next larger number check for 1st bit set x = n&~(n-1) e.g. n = 10100 = 20 n -1 = 10011 x = 10100 & 01100 = 100 for next larger number check for 1st 0 and set the bit thus y = ~x n = y &~(y-1) x |= n x = 10101 = 21 y = 01010 = 10 y-1 = 01001 = 9 n = 101

[algogeeks] Re: Algo for Search in a 2D Matrix

2011-10-13 Thread vikas
@Sunny, good catch, k X k approach wont work lets try to use matrix itself as heap heapify(int cr, int cc, int Nr, int Nc){ mr = cr; mc = cc; if(cr+1 < Nr) mr = cr+1 mc = cc; if(cc + 1 < Nc && min > A[cc+1][cr]) mr = cr; mc = cc+1; if(A[cr][cc] > A[mr][mc]){ swap(&A[cr][cc] ,

[algogeeks] Re: Algo for Search in a 2D Matrix

2011-10-13 Thread vikas
@Sunny, good catch, k X k approach wont work lets try to use matrix itself as heap heapify(int cr, int cc, int Nr, int Nc){ mr = cr; mc = cc; if(cr+1 < Nr) mr = cr+1 mc = cc; if(cc + 1 < Nc && min > A[cc+1][cr]) mr = cr; mc = cc+1; if(A[cr][cc] > A[mr][mc]){ swap(&A[cr][cc] ,

[algogeeks] Re: How to Solve This

2011-10-12 Thread vikas
well , I tried to solve it from Maths though half way through only :( N = number required i.e. (10^k -1)/9 given n = 10x + 3 by eq (10x + 3) * m = N= (10^k - 1)/9 implies k = 2log 3 + log m + log(10x + 3) i.e. k > 1 + log n This gives the lowerbound on minimum number of 1 to be start with, b

[algogeeks] Re: Algo for Search in a 2D Matrix

2011-10-12 Thread vikas
@Shiva, not necessarily in upper half take the transpose of example put by Dave and see by yourself There are few observations for this question: 1. kth smallest will always lie in first k*k matrix 2. it wont be part of sqrt(k)*sqrt(k) matrix Thus rest all need to be searched recursivel

[algogeeks] Re: Tree Center Problem

2011-10-07 Thread vikas
use All Pair Shortest Path On Oct 6, 11:11 am, Nitin Nizhawan wrote: > hi, > >    given a tree with N nodes find the node such that its average total > distance from each other node is smallest > >       i.e.  if nodes are labeled 0N-1 then >          find i such that    [ SUM d(i, j ){0<=j >

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

2011-09-27 Thread vikas
a simple one is rabit-tortoise method, and using stackless traversal, facing a lot of corner cases in coding this, can someone check this as well? On Sep 27, 6:41 pm, anshu mishra wrote: > its not o(n) it is O(max height of tree) :P > i have not seen the constraint. -- You received this message

[algogeeks] Re: Amazon OS question

2011-09-26 Thread vikas
simple graph question, graph is given as list , just check the dependancy On Sep 25, 6:25 pm, siva viknesh wrote: > thanks a lot yogesh... > > On Sep 25, 2:23 pm, Yogesh Yadav wrote: > > > T1->T2->T3->T6 > > T1->T2->T4->T7 > > T1->T2->T5->T8 > > > 2 Processor: > > (T1->T2) ..2 TS > > (T3&T4)

[algogeeks] Re: can any body explain the output and the general method

2011-09-24 Thread vikas
97!! in whatever sequene rule, it can not print 97. probably you want to say 27 :)) On Sep 23, 4:59 pm, Kunal Yadav wrote: > +1 dave > Its giving 97 in my compiler. > > > > On Fri, Sep 23, 2011 at 4:22 PM, vishwa wrote: > > its 21 . > > > On Fri, Sep 23, 2011 at 4:10 PM, vijay singh

[algogeeks] Re: BST in file

2011-09-24 Thread vikas
if this is simple BST then only preorder will suffice On Sep 24, 10:16 pm, wetheart wrote: > You can put the array representation of binary tree directly, with > some obvious modifications ofcourse :) > > On Sep 24, 5:38 pm, asdqwe wrote: > > > you can put two traversals of three (inorder, preor

[algogeeks] Re: opengl

2011-09-21 Thread vikas
redbook, free available ebook On Sep 20, 9:28 pm, punnu wrote: > please somebody suggest some good tutorial in animation in opengl > using c++.. > > thanks in advance -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, se

[algogeeks] Re: Microsoft Question

2011-09-18 Thread vikas
hmm, nice questions, can we create an efficient DS to query the strings ?? tried using trie but memory prints are very large ( O(n^2) )? :-(( On Sep 18, 12:59 pm, Anup Ghatage wrote: > For the mentioned scenario, it seems to be the only feasible solution. > > On Sun, Sep 18, 2011 at 3:57 AM,

Re: [algogeeks] Re: Interview Questions

2011-09-15 Thread vikas singh
o 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 options, visit this group at > http://groups.google.com/gro

[algogeeks] Re: Question --> plz answer

2011-09-12 Thread vikas
4th level nill xt xt nill so you see here water used after 6t time is 2xt + 2*2xt +3*2xt + 2xt = 14 xt or 7 cups here 4th level too have half cups filled , please correct me if something is wrong in calculations. On Sep 12, 3:01 am, Dave wrote: > @Vikas: I think I have it cov

[algogeeks] Re: Question --> plz answer

2011-09-11 Thread vikas
@Dave, should not rate of filling be considered here ? if you note , the side cups are filling in half of rate than to rest of cups in row. On Sep 11, 10:01 am, bharatkumar bagana wrote: > what is M? > > On Sat, Sep 10, 2011 at 8:10 PM, Ishan Aggarwal < > > > > > > > > > > ishan.aggarwal.1...@g

[algogeeks] Re: Questions -->

2011-09-11 Thread vikas
regarding detection of mouth: detect the face and then,try finding the mouth pattern, validate that it is mouth indeed for validation check for eyes, nose at some rational distance .. | --- On Sep 11, 1:11 pm, Anup Ghatage wrote: > ^ Thats correct, apart from which, th

[algogeeks] Re: C puzzle

2011-09-03 Thread vikas
f(19222) | | f(1922) -11 -2 =-13 | | f(192) = -9 -2 = -11 | | f(19) = f(1) - 9 = -9 | | f(1) = 0 output -9 -11 -13 On Sep 3, 10:29 pm, teja bala wrote: > Find the output of the following code - plzzz xplain the o/p > int find(int j) > { > if(j>1) > { > j=find(j/10)-(j%10); > printf

[algogeeks] Re: Closest ancestor of two nodes

2011-09-03 Thread vikas
DON's solution will work On Sep 3, 11:28 am, Abhishek Yadav wrote: > this solution works if parent pointer is given. > 1. Start moving up from both the nodes (if two nodes become equal, fine this > is the common ancestor) till you reach the root node and in between count > the number of nodes you

[algogeeks] Re: String Problem

2011-09-01 Thread vikas
@ above, a third string is used, s3 which is strlen(s2)+ strlen(s1) and thus in O(n) space I guess qs calls out for O(1) space. besides , if we have O(n) space , this question simply reduces to finding the number of permutation of string s1+s2 I doubt we can do it in O(1) space, any idea guys ??

algogeeks@googlegroups.com

2011-08-30 Thread vikas
Must watch Videos for every Indian http://www.daijiworld.com/tvdaijiworld/tvhome.asp?category=live&tv_id=1767 -- 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

[algogeeks] Re: Winshuttle Interview Questions

2011-08-30 Thread vikas
regarding q2: if we have all the points , I guess we need to move through left to right and scan the loop sort this array during scan using Y-distance. now you have the array which will have probable of max diameter from end to end and problem reduce to find out if circle can be created

[algogeeks] Re: How to save a binary search tree space efficiently

2011-08-29 Thread vikas
yep, I realized the mistake. thanks for the clarification. BTW, what approach will be suitable in Bin Tree, extensible to MST . On Aug 29, 11:49 am, prashant thorat wrote: > @vikas : > > you can use recursive approach to draw tree here we go: > >  6 4 3 5 7  8 11 12 > 1 )

[algogeeks] Re: Adobe Interview - 20/08/2011

2011-08-28 Thread vikas
oops On Aug 28, 7:09 pm, Decipher wrote: > @vikas - As i said earlier think in 3D . The correct answer is (sqrt(3) - > 1)R/(sqrt(3) + 1) = r > > Using 3D coordinate geometry if (R,R,R) and (r,r,r) are the coordinates of > center of large and small sphere . Then , make dista

[algogeeks] Re: How to save a binary search tree space efficiently

2011-08-28 Thread vikas
@ Sagar, level order can be stored but you need to remember the nulls always On Aug 29, 12:06 am, sagar pareek wrote: > level order traversal is best for this case :) > > On Sun, Aug 28, 2011 at 11:53 PM, prashant thorat > wrote: > > > > > > > > > > > only preorder will suffice.. considering fact

[algogeeks] Re: How to save a binary search tree space efficiently

2011-08-28 Thread vikas
@Dhriti how about this one 6 4 7 3 5 8 1112 your preorder is 6 4 3 5 7 8 11 12 try reconstruction :)

[algogeeks] Re: inorder predecessor

2011-08-28 Thread vikas
no corner cases .. :D On Aug 26, 5:43 pm, Vikram Singh wrote: > i m writing just a pseudocode... > // root is the root of tree    and   node is the node whose > predecessor is to be found > > predecessor(root, node) > { > parent=NULL; > if(root==NULL) > return ; > > if(node->left!=NULL) >

[algogeeks] Re: puzzle

2011-08-28 Thread vikas
Piyush, nice solution.. On Aug 27, 1:44 am, "icy`" wrote: > Other than making little loops and risking the fall on the first trip > down, I dont think the rope question has an answer.   NVIDIA just > wanted to see if you were suicidal  =D > > On Aug 26, 3:36 pm, Piyush Grover wrote: > > > >

[algogeeks] Re: puzzle

2011-08-28 Thread vikas
lol On Aug 27, 1:44 am, "icy`" wrote: > Other than making little loops and risking the fall on the first trip > down, I dont think the rope question has an answer.   NVIDIA just > wanted to see if you were suicidal  =D > > On Aug 26, 3:36 pm, Piyush Grover wrote: > > > > > > > > > Cut th

[algogeeks] Re: Adobe Interview - 20/08/2011

2011-08-25 Thread vikas
think in 2d and I assume that both the sphere are touching each other. it should be simple 2d maths now :) On Aug 25, 8:32 pm, rakesh kumar wrote: > Could you explain the solution for shere problem > > > > > > > > On Thu, Aug 25, 2011 at 3:49 PM, vikas wrote: >

[algogeeks] Re: vertical sum

2011-08-25 Thread vikas
use this verticalSum(node *root, List *l) { if(root == null) return; root->n += l->n; // check for l->left, l->right and if null, allocate and link them verticalSum(root->left, l->left); verticalSum(root->right, l->right); } On Aug 25, 8:20 pm, Anup Ghatage wrote: > If I'm not

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

2011-08-25 Thread vikas
it is O(n) and complex unnecessary On Aug 24, 3:58 pm, Ankit Minglani wrote: > How about this : > We use a divide and conquer approach and since the array is sorted. > We find the middle element and check its value with its immediate left and > right element .. it must match with anyone of them .

Re: [algogeeks] Android development

2011-08-25 Thread vikas singh
http://linuxconfig.org/get-started-with-android-application-development-using-linux-and-android-sdk this link will definitly gonna give you running HELLO ANDROID app on ua machine. ;) -- Thanks and Regards VIKAS SINGH MCA- final year NIT DURGAPUR email: vikas.singh1...@gmail.com shyguy1

[algogeeks] Re: MS Question

2011-08-25 Thread vikas
yep, trie needs to be built On Aug 24, 10:49 pm, Ankur Garg wrote: > 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 &quo

[algogeeks] Re: Adobe Interview - 20/08/2011

2011-08-25 Thread vikas
5th qs r = R(3-2sqrt(2)) On Aug 25, 1:56 pm, vikas wrote: > @ All, > 1.   build a interval tree using startpoints as the key > 2.   augment this tree such that each interval contains the number of > ppl arrived, in this case 1. > 3.   use this tree and traverse , use this check,

[algogeeks] Re: Adobe Interview - 20/08/2011

2011-08-25 Thread vikas
@ All, 1. build a interval tree using startpoints as the key 2. augment this tree such that each interval contains the number of ppl arrived, in this case 1. 3. use this tree and traverse , use this check, if start/end of tree node is inbetween the interval you are searching, person was there

Re: [algogeeks] C Trick

2011-08-24 Thread vikas singh
On Wed, Aug 24, 2011 at 8:25 PM, praneethn wrote: > *max=(a>b)*a+(b>a)*b;* Not allowed ;) Read the constraints applied. -- Thanks and Regards VIKAS SINGH MCA- final year NIT DURGAPUR email: vikas.singh1...@gmail.com shyguy1...@gmail.com http://smrit.wordpress.com -- You rece

[algogeeks] Need info Regarding CA Technologies

2011-08-24 Thread vikas singh
I need to know, What's the Recruitment Procedure in college of CA Technologies.. Any Link, any info.. Plz Provide it ASAP.. Thanks in Advance :) -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@g

Re: [algogeeks] C Trick

2011-08-24 Thread vikas singh
scribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > Thx, > --Gopi > > -- > You received this message becau

Re: [algogeeks] C code scanf problem

2011-08-24 Thread vikas singh
o compile 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 group, send email to > algogeeks+unsubscr...@googlegroups.com

[algogeeks] Re: MS Question

2011-08-24 Thread vikas
what do you mean by "a function for finding the next word is given" ? On Aug 22, 1:56 am, Ankur Garg wrote: > 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 occurre

[algogeeks] Re: Search an array of unknown length

2011-08-23 Thread vikas
nopes, you need to know where the hell it ends even if this is a string , it ends with convention of ending 0. in case it is stream , we know the data length. in case of array, above mentioned approach should work. sizeof(arr)/sizeof(arr[0]) if you are given only a pointer and no length, you c

[algogeeks] Re: Adobe Interview - 20/08/2011

2011-08-22 Thread vikas
ind an > element in O(log n) > > For the above question, is the array already sorted??? > > > > > > > > On Mon, Aug 22, 2011 at 2:50 PM, vikas wrote: > > using interval tree/segment tree will solve this in straightforward > > fashion > > > On Aug

[algogeeks] Re: Amazon Ques

2011-08-22 Thread vikas
why to bother this much...? just count the elements when popping and output the middle one . while(!s.empty()){ e= s.pop() count++ q.enq(e); } count <<= 2; while(count){ e = q.deq(); s.push(e); count --; } output s.top() while(!q.empty()){ e = q.deq(); s.push(e); } On Aug 22, 4:27 pm, Shravan

[algogeeks] Re: Adobe Interview - 20/08/2011

2011-08-22 Thread vikas
using interval tree/segment tree will solve this in straightforward fashion On Aug 22, 12:41 pm, Jagannath Prasad Das wrote: > for the stick prob is the stick length required? > > On Mon, Aug 22, 2011 at 12:48 PM, Jagannath Prasad Das > wrote: > > > > > > > > > i think find max and min of all tim

[algogeeks] Re: Google Question:Given a BST and a number, Find the closest node to that number in the BST.

2011-08-22 Thread vikas
It seems Dipankar Algo is appropriate at this point of time. each time successor and predecessor check needs to be done at each node and the value need to be updated, This is O(log n) approach because once we check, we move into particular direction. On Aug 21, 4:59 pm, rahul aravind wro

Re: [algogeeks] Syllogism

2011-08-20 Thread vikas singh
eeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Thanks and Regards VIKAS SINGH MCA- final year NIT DURGAPUR email: vikas.singh1...@gmail.com shyguy1...@gmail.com http://smrit.wordpress.com -- You rece

Re: [algogeeks] SISO

2011-08-15 Thread vikas singh
gorithm 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 options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > --

Re: [algogeeks]

2011-08-14 Thread vikas singh
>>>> 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 options,

[algogeeks] Write a program to find the empirical formulae from physical formulae

2011-08-10 Thread vikas
Write a program to find the empirical formulae from physical formulae ex: ch3((oh)2(nh3)2)5 has empirical formulae c1 h43 o2 n10 -- 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.

Re: [algogeeks] Re: sizeof structure

2011-08-06 Thread vikas singh
dev c++.. i m getting correct out put as 24. > when i hav executed ur code on turbo version it shows 11 ,i.e it is doing > no padding at all.. > On Sat, Aug 6, 2011 at 7:21 PM, vikas singh wrote: > >> @sandeep >> >> >> size = 16 address=3220095484 >

Re: [algogeeks] Re: sizeof structure

2011-08-06 Thread vikas singh
Thanks and Regards VIKAS SINGH MCA- final year NIT DURGAPUR email: vikas.singh1...@gmail.com shyguy1...@gmail.com http://smrit.wordpress.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to a

Re: [algogeeks] Re: sizeof structure

2011-08-06 Thread vikas singh
struct demo { char c; double d; int s; }; what wud be the size of struct demo object? if you get the concept, then try this one... just one student asked this in other thread :) :) -- Thanks and Regards VIKAS SINGH MCA- final year NIT DURGAPUR email: vikas.singh1

Re: [algogeeks] Re: sizeof structure

2011-08-06 Thread vikas singh
char :3; ans =1 bytes short u :3; ans=2 bytes -- Thanks and Regards VIKAS SINGH MCA- final year NIT DURGAPUR email: vikas.singh1...@gmail.com shyguy1...@gmail.com http://smrit.wordpress.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geek

Re: [algogeeks] Re: sizeof structure

2011-08-06 Thread vikas singh
expect the PADDING would be.. try it..! -- Thanks and Regards VIKAS SINGH MCA- final year NIT DURGAPUR email: vikas.singh1...@gmail.com shyguy1...@gmail.com http://smrit.wordpress.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks"

Re: [algogeeks] sizeof structure

2011-08-05 Thread vikas singh
ed 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 options, visit this group at > http://groups.goog

[algogeeks] Nagarro is on a recruiting SPREE.......!

2011-08-02 Thread vikas
Hi, To keep pace with the expanding opportunities, we are constantly looking for “the brightest minds” to join Nagarro at various levels(in Gurgaon(india) branch). There are various post for experienced and fresher level guys(asp.net, WPF,Windows,JAVA,FLEX,SHAREPOINT 2010 and SHAREPOINT 2007). Alo

[algogeeks] Nagarro is on a recruiting SPREE.......!

2011-08-02 Thread vikas
Hi, To keep pace with the expanding opportunities, we are constantly looking for “the brightest minds” to join Nagarro at various levels(in Gurgaon(india) branch). There are various post for experienced and fresher level guys(asp.net, WPF,Windows,JAVA,FLEX,SHAREPOINT 2010 and SHAREPOINT 2007). Alo

[algogeeks] Re: Largest BST subtree in Binary Tree

2011-07-13 Thread vikas
correction : ans should be :)                                                        10                                                           \                                                           15                                                         /  \                  

Re: [algogeeks] questions related to C

2011-07-08 Thread vikas
Thanks very much for recommending. By the way, Solutions to any problem posted by anybody, will be available in some or other book. I also knows K&R is a good book. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on

  1   2   >