Re: [algogeeks] [brain teaser ] Statement Riddle

2011-06-27 Thread sharad kumar
i have added anton nomiste as the new moderator... On Mon, Jun 27, 2011 at 5:36 PM, sharad kumar aryansmit3...@gmail.comwrote: banned!!! On Mon, Jun 27, 2011 at 5:32 PM, shady sinv...@gmail.com wrote: if moderators are alive, can they ban him ? On Mon, Jun 27, 2011 at 12:48 PM, Lavesh

[algogeeks] New moderators....

2011-06-15 Thread sharad kumar
hi guys, Regarding the issue of new moderators I have decided to make 1)wladimirufc 2)nishanth 3)siva viknesh as the new moderators..They will assist me to maintain the forum better. I hope they discharge their responsibility in maintaining the dignity of the forum... @all: Please assist them

Re: [algogeeks] Fwd: Supermodels without Makeup (11 images)

2011-06-12 Thread sharad kumar
banned On Sun, Jun 12, 2011 at 9:59 PM, Geo News 22au...@gmail.com wrote: Supermodels without Makeup (11 images http://tinyurl.com/studnt) No matter how gorgeous supermodels look on magazine covers, they can’t always be stunning in real life. Here is a small selection of famous

Re: [algogeeks] FOR ALL INDIANS PLZ READ IT

2011-06-11 Thread sharad kumar
please guys maintain the dignity of the forum...btw I'm the group manager. On Sun, Jun 12, 2011 at 9:17 AM, Priyanshu priyanshuro...@gmail.com wrote: hey harshal, i think u r pretty good in assuming things up.Never did i told all muslims are terrorist nor did i told all pakistanis are

Re: [algogeeks] ADULT SEX PHOTOS

2011-04-16 Thread sharad kumar
BANNED! On Fri, Apr 15, 2011 at 12:51 AM, siddharth srivastava akssps...@gmail.comwrote: Unexpected but most of us have quoted the spam in our replies :-) Well, I guess the moderator is reading and would take an action soon -- Regards Siddharth Srivastava -- You received this

Re: [algogeeks] Puzzle

2011-01-26 Thread sharad kumar
11-(9/9) On Wed, Jan 26, 2011 at 7:42 PM, may.I.answer may.i.answ...@gmail.comwrote: You have four numbers 1 , 1 , 9 ,9 . Now using these four and operator + , - , * ,/ and parentheses(if required) your have to get 10. -- You received this message because you are subscribed to the Google

Re: [algogeeks] celebrity twitters

2010-12-18 Thread sharad kumar
consider it as a directed graph and sink is the celebrity.do dfs to find sink... On Sat, Dec 18, 2010 at 11:30 PM, snehal jain learner@gmail.com wrote: In a n twitter set, a celebrity is defined as someone who is followed by everyone, but who follows no one. You need to identify the

Re: [algogeeks] zero sum subarray

2010-11-06 Thread sharad kumar
keep storing the elements in hash.. now keep adding the elements of array is the sum is -ve calculate -(-sum) ans search in hash. lllrly do it for +ve... O(n) in space and O(n) time i guess On Sat, Nov 6, 2010 at 7:21 PM, MAC macatad...@gmail.com wrote: an array contain +ve and -ve element,

Re: [algogeeks] DP

2010-10-07 Thread sharad kumar
is he allowed to pick only from end?? On Fri, Oct 8, 2010 at 5:44 AM, Anand anandut2...@gmail.com wrote: Given a row of notes (with specified values), two players play a game. At each turn, any player can pick a note from any of the two ends. How will the first player maximize his score?

Re: [algogeeks] coin changing problem

2010-10-05 Thread sharad kumar
int denom(int Coin[],int n,int amount) { for(i=0;in;++i) { c=Coin[i]; for(j=c;j=amount;++j) { den[j]+=d[j-c]; } } return den[amount]; } On Wed, Oct 6, 2010 at 4:43 AM, pre lak pre.la...@gmail.com wrote: Hi all, Pls help me with the solution to the following problem related to the coin

Re: [algogeeks] repeating numbers in an array

2010-10-02 Thread sharad kumar
but i would like to have a different solution .. :) --mac On Sun, Oct 3, 2010 at 10:55 AM, sharad kumar aryansmit3...@gmail.comwrote: cant u use a hash map buddy??? On Sun, Oct 3, 2010 at 10:35 AM, mac adobe macatad...@gmail.comwrote: You are given a very long array of integers . Some

Re: [algogeeks] finding largest and second largest elements

2010-09-27 Thread sharad kumar
hey isn't it suppposed to be tournament problem.. On Fri, Sep 24, 2010 at 12:06 AM, Divesh Dixit dixit.coolfrog.div...@gmail.com wrote: finding largest and second largest elements from a set of n elements by means of Minimum comparison of n+celling(log n) +2 -- You received

Re: [algogeeks] A help please

2010-09-22 Thread sharad kumar
it accepts input into a,b an prints garbage value cos scanf returns the number of values that accept nput ad in printf there is no variable from where value is printed On Wed, Sep 22, 2010 at 2:25 PM, rahul rai raikra...@gmail.com wrote: printf(%d%d,scanf(%d%d,a b)) -- Rahul K Rai

Re: [algogeeks] Help required

2010-09-22 Thread sharad kumar
hey ya man I was also searching for tat ione , Sep 22, 2010 at 8:37 PM, Nikhil Agarwal nikhil.bhoja...@gmail.com wrote: @ankur Please give me a proper link.I mean with hash after 4shared.com On Wed, Sep 22, 2010 at 11:26 AM, ankur aggarwal ankur.mast@gmail.com wrote:

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

2010-09-21 Thread sharad kumar
instead of creating a bst why dontwe create a heap.then sort the heap .then remove the duplictes from string...but will also chnge th order of string. On Sun, Sep 19, 2010 at 4:20 PM, Umer Farooq the.um...@gmail.com wrote: creating a bst would require extra space. You can do this with an

Re: [algogeeks] Re: do this: sorting using reverse()

2010-09-16 Thread sharad kumar
its similar to performing a right rotatate within the specifie boundary the number of times specified by argument On Thu, Sep 16, 2010 at 11:49 PM, Aurelian Tutuianu padre...@gmail.comwrote: A naive way to implement that is: int[] v = new int[100]; // this is my vector with values

Re: [algogeeks] Re: Amazon Question

2010-09-15 Thread sharad kumar
you dont have the structure of the node typedef struct member node { int data; struct member * next; }ll; On Tue, Sep 14, 2010 at 5:57 PM, soundar soundha...@gmail.com wrote: From first linked list set flag value in each traversal of node..then start from second linked list suppose if

Re: [algogeeks] Re: Amazon Question

2010-09-13 Thread sharad kumar
cant it be like '%f%' On Mon, Sep 13, 2010 at 2:55 PM, Praveen Baskar praveen200...@gmail.comwrote: i think that we have to generate substrings from the given string such that the similarity is above 50% for eg. word =foo we have to generate the strings which must be greater than half of

Re: [algogeeks] Amazon Question

2010-09-12 Thread sharad kumar
pagerank algo On Sun, Sep 12, 2010 at 5:42 PM, Snoopy Me thesnoop...@gmail.com wrote: You are given the amazon.com database which consists of names of millions of products. When a user enters a search query for particular object with the keyword say foo , output all the products which have

Re: [algogeeks] array divide problem

2010-09-05 Thread sharad kumar
find sum of array.let it be =S nw we need to find the S/2 then find out which elements that add to S/2 llr to knpsack.. On Sun, Sep 5, 2010 at 8:07 PM, Raj Jagvanshi raj.jagvan...@gmail.comwrote: There is an array of some no only 0-9. You have to divide it into two array such that sum of

Re: [algogeeks] National Instruments: linked list subtraction

2010-08-25 Thread sharad kumar
make use of two ptr approach.first traverse the first linkd list and fnd k th element from last where k is the length of subrahend then perform subtraction. On Wed, Aug 25, 2010 at 8:18 PM, Raj N rajn...@gmail.com wrote: My approach: Use divide and conquer approach. i.e divide(a) divide(b) i.e

Re: [algogeeks] Shuffling a deck of cards

2010-08-14 Thread sharad kumar
for(i=0;i52;++i) { int r=rand()%52; swap(a[i],a[r]); } On Sat, Aug 14, 2010 at 11:46 PM, amit amitjaspal...@gmail.com wrote: write a program to shuffle an pack of cards in the most efficient way. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

Re: [algogeeks] closest pair problem

2010-08-11 Thread sharad kumar
hi, I feel we have discussed the solution to this problem using DP.ts in archives.pls check it On Wed, Aug 11, 2010 at 11:17 PM, Raj N rajn...@gmail.com wrote: Hi, Can someone give me the code for finding closest pair of points using divide and conquer strategy? Thanks !! -- You

Re: [algogeeks] minimum window containing charecters

2010-08-11 Thread sharad kumar
@all:u need to calculate the hash value of very substring(no other go since the letters are in different order we ought to do it).then apply Rain Karp algorithm. On Wed, Aug 11, 2010 at 2:43 PM, Algoose chase harishp...@gmail.com wrote: @ Anand, No , It doesnt Try with String2 = LH

Re: [algogeeks] Microsoft Question

2010-08-09 Thread sharad kumar
nice onefor searching first u need to build the suffix tree for each letter with * once u do it perform a search in other word u need to implement grep command rite?? On Mon, Aug 9, 2010 at 7:00 PM, amit amitjaspal...@gmail.com wrote: Given a text file, implement a solution to find out if a

Re: [algogeeks] bitwise operator confusion

2010-08-08 Thread sharad kumar
in case of -ve numbers irrspectiveof size of compilerits repesented as in remanig space apart from the space of binaryequivalent of number.hence u get On Sun, Aug 8, 2010 at 9:37 PM, navin navin.myhr...@gmail.com wrote: Assunming, integer is 2 byte, What will be the output of the

Re: [algogeeks] Re: BST Problem

2010-08-06 Thread sharad kumar
do the inorder traversal of the bst ...this gives the sorted array.. from that use int i=0,j=length(array) while(ij) { if(array[i]+array[j]sum) --j; else if(array[i]+array[j]sum) ++i; else if((array[i]+array[j])==sum) return i,j else ++i,--j; } On Fri, Aug 6, 2010 at 3:10 PM, Chonku

Re: [algogeeks] Merging Companies Problem

2010-07-31 Thread sharad kumar
Cant u slit it s n/2 companies and merge them recursively .like x^y the multiply x to y/2 time and then multiply tht product twice. On Sat, Jul 31, 2010 at 6:59 PM, sourav souravs...@gmail.com wrote: Suppose we start with n companies that eventually merge into one big company. How many

Re: [algogeeks] number of BST's

2010-07-29 Thread sharad kumar
@amit is it BST or binary tree??cos BST is unique rite???binary tree meas use catalan numbers 2nCn/(n+1)! On Thu, Jul 29, 2010 at 9:56 PM, amit amitjaspal...@gmail.com wrote: Given the numbers from 1 to n, write an algorithm to find how many distinct binary search trees can be formed.. eg

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread sharad kumar
the max width of bst is the largets diff betweeen the min node and max node rite? On Mon, Jul 26, 2010 at 12:30 PM, Chunyuan Ge hhy...@gmail.com wrote: breadth-favorite search? On Mon, Jul 26, 2010 at 2:28 PM, Sathaiah Dontula don.sat...@gmail.comwrote: You mean maximum width of bst ?

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread sharad kumar
, 2010 at 1:00 PM, sharad kumar aryansmit3...@gmail.comwrote: the max width of bst is the largets diff betweeen the min node and max node rite? On Mon, Jul 26, 2010 at 12:30 PM, Chunyuan Ge hhy...@gmail.com wrote: breadth-favorite search? On Mon, Jul 26, 2010 at 2:28 PM, Sathaiah

Re: [algogeeks] Oracle-Java Developer interview question

2010-07-26 Thread sharad kumar
shldnt max width be equal to diameter of the treecorrect me if im wrong On Mon, Jul 26, 2010 at 1:28 PM, vineel yalamarth vineelyalamar...@gmail.com wrote: Dear Sharad,Maximum width of the tree you had drawn is 2...(3,8),(1,4) -- You received this message because you are

Re: [algogeeks] Re: Adobe Strings matching Puzzle.

2010-07-22 Thread sharad kumar
@all:pls make use of KMP algorithm...because knuth morris prat algor On Wed, Jul 21, 2010 at 6:16 PM, anugrah anugrah.agra...@gmail.com wrote: Stack can be used to push the characters of the string A and then popped off while scanning through the string B until there is a difference in the

Re: [algogeeks] find k-th maximum in an unsorted array

2010-07-22 Thread sharad kumar
hey this question was discussed earlier rite???pls make use of Selection algorithm...i think the worst case is O(n+logn). http://en.wikipedia.org/wiki/Selection_algorithm On Thu, Jul 22, 2010 at 9:53 PM, Tech Id tech.login@gmail.com wrote: Write an algo (in less than O(n^2)) to find

Re: [algogeeks] Entryinto elite companies

2010-07-21 Thread sharad kumar
@aparichit:c brother u need to live,breathe enjoy algorithms not studyU shldnt limit ur choice that just because you want to get placed in MS/Google you want to do coding.You need to pursue coding as a career .you need to do it for your self not for entering the company.even if you

Re: [algogeeks] Re: 32 comparisons only

2010-07-13 Thread sharad kumar
@tech id i think in this case we are just optimizing number of comparisons if n is very large use tradational methods like binary or linear search -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] b tree:

2010-07-13 Thread sharad kumar
Find the median in B-tree of order 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+unsubscr...@googlegroups.com. For

Re: [algogeeks] recursive

2010-07-11 Thread sharad kumar
@harit if that is d case plz post d link 4 this ques. remember if u dont want to discuss these ques,u can any time ignore this mail ,let others who are not as sharp as u discuss these questions. PS:this is d ques by amazon in 3rd round of interview -- You received this message because you are

[algogeeks] xoring

2010-07-11 Thread sharad kumar
given a set of numbers u hve to find the pair which give maximum value if we xor that pair ex a={1,3,6,7,8,9} then ans is 15 as 7 xor 8 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] recursive

2010-07-10 Thread sharad kumar
How to do level order traversal using recursion ? -- 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] graph:

2010-07-10 Thread sharad kumar
an adjacency matrix On Sun, Jul 11, 2010 at 8:45 AM, sharad sharad20073...@gmail.com wrote: A graph is given. You need to design a data structure with minimum space complexity such that it does the follows-- Finds whether nodes u and v have a path in between them in O(1) time.-- Finds

[algogeeks] geometry

2010-07-10 Thread sharad kumar
Given a set of points, find the line that intersects the most number of points -- 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] Re: microsoft.

2010-07-08 Thread sharad kumar
@souravsain i want 2 in your example -- 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+unsubscr...@googlegroups.com. For

Re: [algogeeks] HIEGHT

2010-07-08 Thread sharad kumar
@anand i want iterative not recursive soln -- 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+unsubscr...@googlegroups.com.

Re: [algogeeks] ipc

2010-07-07 Thread sharad kumar
@harit why pipes are fastest...plzz explain a bit -- 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] Plz help with multidimensional array

2010-07-07 Thread sharad kumar
@ashish cant u make use of char *p[30] for 2 d array On Wed, Jul 7, 2010 at 9:34 AM, Ashish Goel ashg...@gmail.com wrote: char name[][10] is a auto variable on stack, so no pointers here Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652

Re: [algogeeks] amazon:-

2010-07-07 Thread sharad kumar
this the same hamming distance problem...this can be done thorugh trie.pls check archives this has been discussed before.. On Wed, Jul 7, 2010 at 10:12 AM, Ashish Goel ashg...@gmail.com wrote: use levenstein distance algo http://en.wikipedia.org/wiki/Levenshtein_distance Best

Re: [algogeeks] microsoft.

2010-07-07 Thread sharad kumar
ya i want inplace soln -- 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+unsubscr...@googlegroups.com. For more options,

Re: [algogeeks] google

2010-07-07 Thread sharad kumar
@topojoy ur understanding of problem is fully correct -- 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] amazon:-

2010-07-06 Thread sharad kumar
Given a string A, and a string B, and a dictionary, how would you convert A to B in the minimum no of operations, given that: i) All the intermediate words must be from the dictionary ii) An ‘operation’ is defined as: a) Delete any character from a string ex dog → do b) Insert any character

[algogeeks] microsoft.

2010-07-06 Thread sharad kumar
Given an array of n numbers in which all the members are less than or equal to k (kn). device an algorithm of order O(k) to find the first repeating element -- 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] oops

2010-07-05 Thread sharad kumar
i also think same for the first answer -- 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+unsubscr...@googlegroups.com. For

Re: [algogeeks] shift operators

2010-07-05 Thread sharad kumar
For signed values, if the high-order bit is a 1, the number is negative. (This is true for 1's complement, 2's complement, and sign-magnitude representations.) If you were using a right shift to implement division, you'd want a negative number to stay negative, so on some computers, under some

Re: [algogeeks] array

2010-07-05 Thread sharad kumar
@amir if it is 2n+k then how do u proceed ur soln become O(kn) -- 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] merge sorted lists

2010-07-05 Thread sharad kumar
@divya complexity according to ur ques shud be O(klog n) (thats what i think ... i may be wrong) plzzz check 4m source where u take ques -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] isr

2010-07-05 Thread sharad kumar
You have a system in which there is a timer that interrupts the system every 20ms. If the system is interrupted, an ISR runs to handle that interrupt. How will you design your system to find if that ISR runs for more than 20ms [in most cases an ISR will be very short...but assume in this case its

[algogeeks] ipc

2010-07-05 Thread sharad kumar
which is the fastest IPC mechanism between Semaphores, Monitors, Message passing and Signals -- 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

Re: [algogeeks] Re: isbst

2010-07-04 Thread sharad kumar
@dheeraj for this tree inorder is 12 14 13 first 12 comes,it is saved in temp now 14 comes since 1412 so temp =14 now when 13 comes which is less than temp hence not a bst correct me if i wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group.

Re: [algogeeks] Re: merge sorted lists

2010-07-04 Thread sharad kumar
@dave u r rite its my fault -- 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+unsubscr...@googlegroups.com. For more

[algogeeks] google favourite ques

2010-07-03 Thread sharad kumar
explain in detail what happens in all d 7 layers of osi model when u type www.google.com in ur browser -- 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

Re: [algogeeks] merge sorted lists

2010-07-03 Thread sharad kumar
1. First take two lists at a time and merge them so total elements parsed for all lists =O(n) This operation results in k/2 lists 2. Repeat steps till k/2 == 1. *Time complexity of above solution = O(n logk)* Step1 would loop through *logk *times and each operation would require parsing all n

[algogeeks] lru cache

2010-07-02 Thread sharad kumar
how would u implement LRU cache -- 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+unsubscr...@googlegroups.com. For more

Re: [algogeeks] Binary trees with 3 nodes

2010-07-02 Thread sharad kumar
catalan numbers.(2n)Cn/(n+1) On Sat, Jul 3, 2010 at 1:06 AM, Raj N rajn...@gmail.com wrote: How to find all the possible trees with 3 nodes from a given tree -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

[algogeeks] point lying inside or not

2010-07-01 Thread sharad kumar
a polygon is given(convex or concave) given a point u have to find whether it is lying inside polygon or not -- 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

Re: [algogeeks] computational geometry

2010-07-01 Thread sharad kumar
@Amir i m not able to understand how complexity is o(n) if u r doing for all vertices...plzz elaborate -- 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

Re: [algogeeks] Re: point lying inside or not

2010-07-01 Thread sharad kumar
@dave thnx now i understood the soln @sharad can u tell me how it can be done using convex hull algo -- 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

Re: [algogeeks] point lying inside or not

2010-07-01 Thread sharad kumar
@jalaj ur method fail when it is lying on the corner plzz consider case for that also -- 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

Re: [algogeeks] BST with duplicates?

2010-07-01 Thread sharad kumar
no a bst cant hve duplicates -- 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+unsubscr...@googlegroups.com. For more

Re: [algogeeks] crazy

2010-06-29 Thread sharad kumar
ya its 1/2 proof gvn in www.techinterview.org On Tue, Jun 29, 2010 at 12:37 PM, ankur aggarwal ankur.mast@gmail.comwrote: i think it shud be 1/2.. i will try to prove it... On Mon, Jun 28, 2010 at 8:52 AM, sharad kumar sharad20073...@gmail.comwrote: Problem :- A line of 100 airline

[algogeeks] complete binary tree

2010-06-29 Thread sharad kumar
A *complete binary tree* is a binary tree in which every level, *except possibly the last*, is completely filled, and all nodes are as far left as possible write a code which check whether a given tree is complete or not -- You received this message because you are subscribed to the Google

Re: [algogeeks] second shortest path

2010-06-28 Thread sharad kumar
@divya plzzz elaborate ur approach a bit more...i didnt get u -- 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] common

2010-06-26 Thread sharad kumar
Given two log files, each with a billion usernames (each username appended to the log file), find the usernames existing in both documents in the most efficient manner? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group,

[algogeeks] rotation

2010-06-26 Thread sharad kumar
i have to right rotate an array by k positions 1 2 3 4 5 for k=2 o/p shud be 3 4 5 1 2 P.S---do not give block reversal method for array rotation and soln must be inplace.plzz write ur logic also along with d code -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] c

2010-06-26 Thread sharad kumar
@harit but it is static so internal linkage is there then how it can be changed by external source may b i m mis understanding...so plzzz make it more clear -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] shuffle

2010-06-26 Thread sharad kumar
randperm( A ): for i in range(0, n): t = i+1 + random(, n - i-1 ) swap(A[t], A[i]) note that the permutation is in-place. Anil On Sat, Jun 26, 2010 at 4:55 PM, sharad kumar sharad20073...@gmail.comwrote: Write a method to shufle the deck. The constraint is it has

Re: [algogeeks] Re: equal prob

2010-06-26 Thread sharad kumar
@above probabilty for all numbers in d stream must be *same*.whether first or last -- 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

[algogeeks] arrays

2010-06-26 Thread sharad kumar
Give an unsorted array find count of pairs of numbers[a,b] where a b and b comes after a in the array. Eg. {8,3,6,10,5} the count of such numbers is 5. i.e. (8,3), (8,6), (8,5), (6,5) and (10,5) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks

[algogeeks] Puzzle .

2010-06-25 Thread sharad kumar
There are two robot standing on two ends of a line, somewhere on the line there is a point and I need to make both robot reach that point. Same program is running in both robots. Only instruction allowed is : Move Left, Move Right, Am I on point. Tell how both the robots will meet. -- You

[algogeeks] c

2010-06-25 Thread sharad kumar
static const volatile int x; Is the declaration valid plzzz explain -- 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] c

2010-06-25 Thread sharad kumar
no its not cos u have declared const and volatile hw is it possible can u go to IIT and IIM at same time On Sat, Jun 26, 2010 at 9:22 AM, sharad kumar sharad20073...@gmail.comwrote: static const volatile int x; Is the declaration valid plzzz explain -- You received this message

Re: [algogeeks] c

2010-06-25 Thread sharad kumar
cos if u declare const u cant change na.but volatile changes na.so practically u cant declareU cant do mtech at IIT and MBA at IIM at same time rite??? On Sat, Jun 26, 2010 at 10:43 AM, sharad kumar aryansmit3...@gmail.comwrote: no its not cos u have declared const and volatile hw

Re: [algogeeks] find all the combination of number whose sum is n

2010-06-22 Thread sharad kumar
i knoe c++ well so i can understand java code bt i m not able to understand this code so pl explain it or give algo thnx 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] sum k in sub array

2010-06-22 Thread sharad kumar
How will you find the subarray whose sum is k in an array of negative and positive numbers -- 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

Re: [algogeeks] find all the combination of number whose sum is n

2010-06-22 Thread sharad kumar
thnx Raajay n Jeeva for giving so clear explainations bt actually my question is ...if i/p is 5 then u hve to print 1+4 1+1+3 1+1+1+2 1+1+1+1+1 1+2+2 1+4 2+3 and all such pairs giving 5 i hope i m clear this time -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] find all the combination of number whose sum is n

2010-06-22 Thread sharad kumar
@ Jeeva...abt ur soln when a[1] comes i.e 2 so i think according to algo 10-2 i.e 8 must go in plzz correct me if i wrongly understood it -- 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] n ary tree

2010-06-21 Thread sharad kumar
sry ..whatever u have posted ...i hve posted this approach mistakenly in lexographically next string waale mewaise i think this approach works -- 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] Array Problem

2010-06-21 Thread sharad kumar
@jalaj one more constraint is there ij -- 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+unsubscr...@googlegroups.com.

Re: [algogeeks] max of 2 numbers

2010-06-20 Thread sharad kumar
max = x-((x-y)(x-y)sizeof(int)*8 -1 -- 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+unsubscr...@googlegroups.com. For

Re: [algogeeks] max of 2 numbers

2010-06-20 Thread sharad kumar
@anand it should be max=x - ( ( x - y ) ( ( x - y ) 31 )) -- 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] c code.....explaine output

2010-06-20 Thread sharad kumar
@anand:its similar to reference an array element using pointer...*(p+i) which is imilar to p[i] when u put *before the value gets dereferenced and hence p+i takes place same concept On Sun, Jun 20, 2010 at 3:27 PM, anand anandandymn...@gmail.com wrote: it caculate the sum of two numbers.

Re: [algogeeks] c code.....explaine output

2010-06-20 Thread sharad kumar
@anand:he takes the value at particular byte by using char*...same u do for chcking endianess rite...same concept On Sun, Jun 20, 2010 at 3:39 PM, sharad kumar aryansmit3...@gmail.comwrote: @anand:its similar to reference an array element using pointer...*(p+i) which is imilar to p[i] when u

Re: [algogeeks] balance tree

2010-06-20 Thread sharad kumar
no ...if buffer is given then its trivial... -- 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] lexicographically next string

2010-06-20 Thread sharad kumar
is this approach works 1. write the post order traversal of T1 and T2 and save it in strings P1 and P2. 2. similarly write the In order traversal of T1 and T2, saving it in strings I1 and I2. 3. if T1 contains T2, then P1 contains P2 and I1 contains I2 as substrings. -- You received this message

Re: [algogeeks] OS problems

2010-06-19 Thread sharad kumar
for 1 other reasons apart 4m d 1 told by harit are 1)in every os,a user has maximum space allocated to him according to his previlege so ... may be it is exceeding that maximum capacity 2)it may be possible that it has exceeded total space available to whole os i.e it may be smaller system having

Re: [algogeeks] c book

2010-06-19 Thread sharad kumar
@vishal :pls read How to program C Deitel and Deitel.its best book i have ever read... On Sun, Jun 20, 2010 at 1:21 AM, vishard sankhyan er.vish...@gmail.comwrote: hii pls suggest me a book for c, i just want to make my base strong.. -- You received this message because you are

Re: [algogeeks] Width of the tree

2010-06-18 Thread sharad kumar
/ \ \ 45 8 / \ 67 For the above tree, width of level 1 is 1, width of level 2 is 2, width of level 3 is 3 width of level 4 is 2. So the maximum width of the tree is 3. On Thu, Jun 17, 2010 at 5:07 PM, sharad kumar aryansmit3

Re: [algogeeks] file opening mode

2010-06-17 Thread sharad kumar
plzzz dont post ur homework questions here look them on google -- 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] Width of the tree

2010-06-17 Thread sharad kumar
do u meand diameter of tree?? if it is so then start from the left most node in tree and traverse upto root and traverse to the rightmost node in tree..this u can do by having extra field in tree which is parent pointer On Fri, Jun 18, 2010 at 4:25 AM, Anand anandut2...@gmail.com wrote: Any

Re: [algogeeks] sum to 0

2010-06-17 Thread sharad kumar
@senthilnathan prepare a hash table for the third array now pick any element 4m array 1 add it to 1 element of array 2 now try to find -(m+n) in hash table since every element of arr1 will be sum to every arr of array2 and lookup in hash table to be O(1) so overall complexity will be O(n2)

[algogeeks] regarding questions being repeated

2010-06-17 Thread sharad kumar
.and we can continue from that .hence it will also give more valuable and complete solutions. Thanks and Regards, Sharad Kumar J Manager AlgoGeeks. -- yezhu malai vaasa venkataramana Govinda Govinda -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

  1   2   3   >