[algogeeks] Re: All numbers in Array repeat twice except two

2010-10-04 Thread Rahul
It has a trivial sol-n use xor first time to all the numbers o(n) partition on the basis of last set bit of the result of xor o(n) now use xor in both the two partitions separately and here u get the two numbers :) - Sincere Regards Rahul Verma Computer Science and Engineering B.Tech 3rd

Re: [algogeeks] please explain the pointer math on page 22 of this pdf

2010-09-29 Thread rahul rai
x = 0; index < size; index++) { > if (parr[index] == val ) > return &parr[index] ; > } > > return NULL; > } > > please let me know if you have any comments. > > Thanks, > Sathaiah > > On Tue, Sep 28, 2010 at 11:34 PM, rahul rai wrote: &

[algogeeks] please explain the pointer math on page 22 of this pdf

2010-09-28 Thread rahul rai
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-087-practical-programming-in-c-january-iap-2010/lecture-notes/MIT6_087IAP10_lec05.pdf Thanking In Advance -- Rahul K Rai "And The Geek Shall Inherit The Earth" -- You received this message because you are sub

Re: [algogeeks] Algorithm to determine the largest number of envelopes that can be nested inside one another.

2010-09-28 Thread Rahul Singal
A possible solution i can think is create a directed graph where each vertex is a envelope and edges are from a bigger envelope to smaller envelope ( one which can fit in bigger envelope ) . Now the problem is reduce to finding longest path in the graph . Regards Rahul -- You received this

Re: [algogeeks] Re: next multiple of 8

2010-09-27 Thread rahul
Please correct. ans = (x|7)+1. Thanks Dave. On Mon, Sep 27, 2010 at 5:42 PM, saurabh agrawal wrote: > This problem is already solved. > ans=(x|1)+1 > > > On Mon, Sep 27, 2010 at 5:15 PM, nishaanth wrote: > >> try x+8-(x&7 ) >> >> On Sep 26, 4:47 am, Dave wrote: >> > @Shrevan: I mistyped what

Re: [algogeeks] Re: do this: two numbers with min diff

2010-09-27 Thread rahul
If their is no constrain on assumptions. 1.Sort the array. 2. check the dif between 2 elements. { 99,35,45,33,88,9098,112,33455,678,3} sorted arrary : { } would be something. now update the min_diff. another example : { 7,8,1,3,5,4} sorted arrary : { 1,3,4,5,7,8} min diff is 1. Please correct

Re: [algogeeks] Re: Bitwise operator - Adobe

2010-09-25 Thread Rahul Singal
let the number be x . solution = x - (x%8) + 8; -- 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...@googlegroup

Re: [algogeeks] Re: Bitwise operator - Adobe

2010-09-25 Thread rahul
Example, (a) For the number 12, the next multiple of 8 is 16. (b) For the number 16, the next multiple of 8 is 24. did u mean next multiple of 8 greater than given number(12 or 16). ? On Sat, Sep 25, 2010 at 5:28 PM, Krunal Modi wrote: > Basically, I am starting from (ans=)0 & checking if it ha

Re: [algogeeks] Fwd: another help please

2010-09-25 Thread rahul rai
Yes , i. Can , and i did , but is't there a shortcut . I want to know that 2010/9/24, mohit ranjan : > Dear Rahul, > > Can you try writing hex digits in binary and try. > > 0x77 --> 0111 0111 > 0x03 --> 0011 > --- > AND

[algogeeks] A help please

2010-09-22 Thread rahul rai
"printf("%d%d",scanf("%d%d",&a &b))" -- Rahul K Rai rahulpossi...@gmail.com -- 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.co

Re: [algogeeks] Re: do this: two numbers with min diff

2010-09-21 Thread Rahul Singal
try running it on [ 11 , 6 , 100, 101] -- 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

[algogeeks] Re: Multiplication of two numbers

2010-09-20 Thread Rahul
iscussion for this question. Please correct me if m wrong. On Sep 20, 7:47 pm, Dave wrote: > @Rahul. No. Considering your example 33*30, x*y + x + y = 3*3 + 3 + 3 > = 15 is not < 10, so, as specified by Sumant, "u will need a complex > logic to solve". > > Dave > > On

Re: [algogeeks] Multiplication of two numbers

2010-09-20 Thread rahul patil
hich says ans will be 4 digit but ans is 990 which is 3 digit. >> On Mon, Sep 20, 2010 at 10:50 AM, rahul patil < >> rahul.deshmukhpa...@gmail.com> wrote: >> >>> A partial solution is , if you multiply first digits of two nos and >>> result is greater

Re: [algogeeks] Multiplication of two numbers

2010-09-19 Thread rahul patil
e 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, visit this group at > http://groups.google.com/grou

Re: [algogeeks] Yahoo Question

2010-09-15 Thread Rahul Singal
. repeat 2 and 3 till all list are empty. Regards Rahul Singal 3rd yr , Computer Science Department Birla Institute of technology and Science , Pilani -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email

Re: [algogeeks] Re: Amazon Question make confused !!!!!!!

2010-09-15 Thread rahul patil
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, visit this group at >&g

Re: [algogeeks] Aricent question

2010-09-11 Thread Rahul Singal
This is O(n) solution. first check if 2 consecutive element in an array are same or not . If they are same we have the solution. otherwise check the first 3 element and find out which 2 elements are same. I hope it works. -- You received this message because you are subscribed to the Google Grou

Re: [algogeeks] Re: how we can access 2nd element of an struct

2010-09-09 Thread rahul patil
se 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, visit this group at >

Re: [algogeeks] Re: Maximum of N numbers

2010-09-06 Thread rahul patil
what if A[i] is a large negative no On Mon, Sep 6, 2010 at 7:20 PM, Rahul Singal wrote: > sorry you dont need to use != operator > > > > A[1,2,3.N] > max=A[1]; > for i=2,3,.N > if(( A[i]/max)) >max=A[i]; > > is it fine ?? > >

Re: [algogeeks] Re: Maximum of N numbers

2010-09-06 Thread Rahul Singal
sorry you dont need to use != operator A[1,2,3.N] max=A[1]; for i=2,3,.N if(( A[i]/max)) max=A[i]; is it fine ?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@goo

Re: [algogeeks] DeShaw Question....tough One

2010-09-06 Thread Rahul Singal
Ashim can you please explain the code . thanx 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 algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@go

Re: [algogeeks] Maximum of N numbers

2010-09-06 Thread Rahul Singal
You can use division operator pseudocode A[1,2,3.N] max=A[1]; for i=2,3,.N if( A[i]/max !=0) max=A[i]; -- 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.

Re: [algogeeks] Modified subset-sum problem

2010-08-30 Thread rahul patil
il to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Regards, Rahul Patil -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" gr

Re: [algogeeks] Re: Adobe Question : Convert a number given in base B1 to a number in base B2 without using any intermediate base

2010-08-29 Thread rahul patil
printf("%c",result[i]+0x30); else printf("%c",result[i]+0x40-9); i--; } return 0; } On Sun, Aug 29, 2010 at 11:16 PM, luckyzoner wrote: > @Rahul : I know that u are using table of base b2 in base b1 and then > dividing the num

Re: [algogeeks] Re: Amazon interview Question (Array yet again!)

2010-08-29 Thread rahul patil
-1 each time */ printf ("\n minimum cost = %d \n sorted array =",final_cost); print_ans(); return 0; } On Sun, Aug 29, 2010 at 2:18 PM, jagadish wrote: > > @Rahul Patil: > I ran your code on some basic test cases and i found it to be > correct! > > Can

[algogeeks] Re: Amazon interview Question (Array yet again!)

2010-08-29 Thread rahul patil
check out this solution.I think this works correct will explain logic if u find it correct. #include #define SIZE 4 int result[SIZE]; int final_cost = 10; int curr_ans[SIZE]; void save_arr(int *result) { int i; for (i=0 ;i= 0) { // keep the arr[index] if (arr[index] <= mi

[algogeeks] Re: Longest SubSequence with Sum < K

2010-08-28 Thread rahul patil
Is it required that sub array must be continuous. On Aug 18, 12:34 pm, Amit Jaspal wrote: > You have to return the length of the subsequence with longest length and sum > < K . If there are multiple solutions report anyone. > > On Wed, Aug 18, 2010 at 12:40 PM, srinivas reddy > wrote: > > > > > s

[algogeeks] Re: Adobe Question : Convert a number given in base B1 to a number in base B2 without using any intermediate base

2010-08-28 Thread rahul patil
)- | ^ 0 3*7 + 49 = 70 /9 = 7 (rem 7) --- | ^ 070 6*1 + 7 = 13/9 = 1 (rem 4) 070 104 = 84 On Aug 21, 12:41 am, bittu wrote: > @ Rahul

Re: [algogeeks] Amazon interview Question (Array yet again!)

2010-08-27 Thread Rahul Singal
can u decrement d same element more then once ?? -- 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...@googlegroup

Re: [algogeeks] Re: Sorting when n-√n numbers are already sorted

2010-08-26 Thread Rahul Singal
@saurav I dont think in place approach is possible . This will end up taking n^2 time . -- 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 ema

[algogeeks] Re: Binary tree to LL

2010-08-26 Thread Rahul
how to rearrange the pointers ?? -- 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] Re: Subsequence

2010-08-26 Thread Rahul
@ bittu input : 6 1 4 8 3 7k=2 output : 6 + 8 =14 it's not 7+8=15 which wud be the case if ul apply sorting and take k largest elements. if i got ur point correct. Rahul Verma NIT Allahabad -- You received this message because you are subscribed to the Google Groups "Algor

Re: [algogeeks] Sorting when n-√n numbers are alre ady sorted

2010-08-26 Thread Rahul Singal
merge sort or quick sort or insert last root(n) element . This will take max n time . now merge the last root(n) element with the starting element .this will take n time . so final time complexity is n < nlog(n) Rahul -- You received this message because you are subscribed to the Goo

[algogeeks] Re: Subsequence

2010-08-26 Thread Rahul
@ raj Input: 5 4 6 7 3 2 9 8 and if k=3 output : 6 + 7 + 9 remember it's subsequence not substring. -- 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 gr

[algogeeks] Re: Subsequence

2010-08-26 Thread Rahul
Guys the problem is similar to lcs with just a little difference that here we don't have to maximize the lenght of subsequence but we have to maximize the sum for a given number of elements(k) which should be in non-decreasing order. ex : input : 6 4 2 7 5 8 7 8 k=4 output : 6+7+8+8=29 -- You

[algogeeks] Re: Subsequence

2010-08-25 Thread Rahul
@Jaswanth It will be really kind if you will state the algorithm rather than providing codes, as it is tedious. -- 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 fr

[algogeeks] Subsequence

2010-08-24 Thread Rahul
How to find out Non-Decreasing subsequence of length k with maximum sum in an array of n integers ? -- 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 grou

Re: [algogeeks] Re: Adobe Questions

2010-08-20 Thread Rahul Singhal
"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, visit this group at > http://groups.google.com/group/algogeeks

[algogeeks] Re: How to find two missing numbers from an unsorted continuous natural numbers array [only use O(1) space and O(n) time]

2010-08-20 Thread rahul patil
do we know the range of nos in array? is it possible that negative nos are in array? On Aug 12, 6:50 pm, Dave wrote: > @ashish. The product will overflow for even moderate n, so instead, > form the sum and the sum of the squares of the numbers. If a and b are > the missing numbers, they satisfy

[algogeeks] Re: How to find two missing numbers from an unsorted continuous natural numbers array [only use O(1) space and O(n) time]

2010-08-20 Thread rahul patil
Is there any restriction that array must be start from 0 or 1 ? or it can start from any no ? On Aug 12, 6:50 pm, Dave wrote: > @ashish. The product will overflow for even moderate n, so instead, > form the sum and the sum of the squares of the numbers. If a and b are > the missing numbers, th

Re: [algogeeks] Adobe Question : Convert a number given in base B1 to a number in base B2 without using any intermediate base

2010-08-18 Thread Rahul Singhal
gt; 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] Re: Shuffling a deck of cards

2010-08-15 Thread Rahul Singhal
> >http://groups.google.com/group/algogeeks?hl=en. > > > > -- > > yezhu malai vaasa venkataramana Govinda Govinda > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send

Re: [algogeeks] Re: Addition Of numbers in SLL

2010-08-14 Thread Rahul Singhal
p, send email to > algogeeks+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Rahul singhal RnD Engineer Tejas Networks Mobile- 09916969422 -- You received this message because you are subscribed to the Goo

Re: [algogeeks] Re: Addition Of numbers in SLL

2010-08-14 Thread Rahul Singhal
t to this group, send email to algoge...@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. > > -- Rahul singhal RnD Engineer

Re: [algogeeks] a help

2010-08-14 Thread rahul rai
Thanks a lot , it's a life saver , i will work it out fully . 2010/8/14, Asit Baran Das : > http://graphics.stanford.edu/~seander/bithacks.html > <http://graphics.stanford.edu/~seander/bithacks.html>it has all that you > need. > > On Sat, Aug 14, 2010 at 7:53 PM, rahul r

[algogeeks] a help

2010-08-14 Thread rahul rai
can anyone suggest me lectures / videos for BASICS of BITS manipulation? thanks in advance Rahul K Rai rahulpossi...@gmail.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@google

Re: [algogeeks] Re: P ! = NP

2010-08-12 Thread rahul rai
http://www.hpl.hp.com/personal/Vinay_Deolalikar/Papers/pnp12pt.pdf Rahul K Rai rahulpossi...@gmail.com 2010/8/12 Avik Mitra > We are proud that an Indian has attempted to solve this problem. > > Avik > > -- > You received this message because you are subscribed to

[algogeeks] Re: Median of two arrays..

2010-08-11 Thread rahul patil
is there any time complexity? the also can be like this char *res; char *ptr1 =arr1; char *ptr2 =arr2; int count =0, n= len(arr1) ,m=len(arr2); while(1){ while(*ptr1 > *ptr2){ ptr2++; count ++; if( count == (n+m)/2 ){

[algogeeks] Re: Doubly linklist to Singly linklist...........

2010-08-08 Thread Rahul Verma
XOR Linked list tutorial http://en.wikipedia.org/wiki/XOR_linked_list On Aug 8, 11:49 am, Pramod Negi wrote: > Search XoR List on Wiki > > On Sun, Aug 8, 2010 at 10:19 AM, UMESH KUMAR wrote: > > > how to convert Doubly Link list to a Singly link list without changes > > the Structure of the list

[algogeeks] Re: Generate a number

2010-07-31 Thread rahul patil
can u give example? is it like that for 3 , a no which is made of 1st ,2nd and 3rd digit should be divisible by 3 or individual all three digits must be divisible by 3? A 2nd case seems impossible. On Jul 30, 9:12 am, "Shiv ..." wrote: > If space is not a restriction- > > Build a B-tree. > 1.

[algogeeks] Re: BST

2010-07-26 Thread rahul patil
@ Gene Your solution seems great and most appropriate one. Just need to create threads in BST first.What will be time complexity for that? On Jul 25, 11:08 pm, Gene wrote: > You'd know how to do this if you had a sorted array A, right?  Start a > pointer at each end. Call the L and R. > > L = 0;

[algogeeks] Re: BST

2010-07-25 Thread rahul patil
oot->right=root; >           append(l,root); >           append(l,r); >           return l; > > } > > here append function merges two circular doubly linked lists , you can make > that on your own > > On Sun, Jul 25, 2010 at 1:35 PM, Debajyoti Sarma > wrote: > &

[algogeeks] Re: BST

2010-07-24 Thread rahul patil
1> convert the BST into a sorted doubly linklist.(increasing order) It will take O(n) time. 2> Now find two nodes in a link list whose sum is k(given no) to find sum in linklist. take two pointers ptr1= head ptr2=tail of linlist. now find sum of ptr1->data + ptr2-> data while(ptr1->data < ptr2-

Re: [algogeeks] Dynamic Programming Problem on Strings

2010-07-17 Thread Rahul Singhal
his group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > 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 unsubsc

[algogeeks] a correction in probability problem

2010-07-11 Thread rahul rai
/tut01_sol.pdf Rahul K Rai -- 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 mo

[algogeeks] a favor

2010-07-11 Thread rahul rai
ons/tut01_sol.pdf Rahul K Rai -- 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.

Re: [algogeeks] malloc implementations

2010-07-05 Thread rahul rai
http://www.youtube.com/user/StanfordUniversity#p/c/9D558D49CA734A02 these are the best to learn about real implementation of C lang the lectures number 1 to 10 Rahul K Rai rahulpossi...@gmail.com 2010/7/5 amit : > Hi, can anybody tell me how is malloc implementedany links

[algogeeks] a request please

2010-07-05 Thread rahul rai
can anyone tell me how to find front page in office 2003 Rahul K Rai rahulpossi...@gmail.com -- 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] Re: number of 1's

2010-07-04 Thread Rahul Kushwaha
@ashish : you are correct but the number of bits in the integer datatype is fixed while using anding algo.. but the looping algorithm is valid for any number of bit in the integer.. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to t

Re: [algogeeks] Re: C declaration

2010-07-04 Thread Rahul Kushwaha
this type of error is prominent in turbo c compilers.. but above mentioned c99,gcc and many other allow mixing of declarations.. -- 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.c

Re: [algogeeks] Re: number of 1's

2010-07-04 Thread Rahul Kushwaha
no of bits set int v; int c; for(c=0;v;c++) v&=v-1; this is best method without consideration of no of bits in an integer and for executes only the number of times the bit is set in the number// -- You received this message because you are subscribed to the Google Groups "Algorithm

Re: [algogeeks] 2_D matrix

2010-07-02 Thread Rahul Kushwaha
i think this might work Binsearch on matrix for the column in which the element may lie... use last element of the coloumn for comparisons \ then binsearch in the coloumn to find if the element is there or not -- You received this message because you are subscribed to the Google Groups "

Re: [algogeeks] rand 7

2010-06-27 Thread Rahul Singhal
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] Re: seg fault

2010-06-22 Thread Rahul Singhal
t; 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, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Rahul sing

Re: [algogeeks] c array

2010-06-12 Thread Rahul Kushwaha
#include int main() { char str[7]="strings"; printf("%s\n",str); return 0; } it is showing error on code block and dev cpp also... this is an error no doubt. also mentioned in denis m ritchie -- You received this message because you are subscribed to the Google Groups "Algorithm G

Re: [algogeeks] tree from linked list

2010-05-09 Thread rahul rai
can anyone give me links to more educative and active groups like algogeeks On Sun, May 9, 2010 at 2:11 AM, Arun prasath wrote: > This does not create a balanced tree but ensures that every element in the > tree is accessible by lg(n) time. > > Time : Complexity   O(n) > > > [a...@91blore-srv1 ~]

Re: [algogeeks] Finding the mode in a set of integers

2010-04-16 Thread rahul rai
On 4/16/10, Rohit Saraf wrote: > Just got another O(n) solution. > > Find the n/2 th largest element in the array using the Median of Medians > Selection algorithm. =? takes O(n) > That's It ! > > > -- > Rohit Saraf > Second Year Undergraduate, > D

Re: [algogeeks] Finding the mode in a set of integers

2010-04-14 Thread Rahul Singh
How about bucket sort. On Wed, Apr 14, 2010 at 6:33 PM, Rohit Saraf wrote: > O(n log n) will be trivial. > > O(n) is required at any cost. (Consider the case with 501 "1"s and 499 > "0"'s) > > Ok, so u can make a hashmap with your integer as keys and frequency as the > value. >No of keys will

Re: [algogeeks] Re: Finding youngest common ancestor of two nodes in a binary tree

2010-04-08 Thread Rahul Singh
. Now you have 2 paths, first deviation of path is ur youngest ancestor -rahul On Thu, Apr 8, 2010 at 9:11 PM, Anurag Sharma wrote: > @Rahul, > The Tree is not Binary "Search" Tree. > > Anurag Sharma > http://anuragsharma-sun.blogspot.com/ > > > On Thu, Ap

Re: [algogeeks] Re: Finding youngest common ancestor of two nodes in a binary tree

2010-04-08 Thread Rahul Singh
Perform inorder traverse for both the node. match element by element the 2 strings and when first time the string deviates thats Lowest common ancestor. -rahul On Thu, Apr 8, 2010 at 6:21 PM, Anurag Sharma wrote: > @Dave, > Thanks for pointing out the limitation in my algorithm. I

Re: [algogeeks] Re: Find parent/grandparent relationship of nodes in binary tree in O(1) time

2010-03-10 Thread Rahul Singh
for every node , store a struct , such that it has parent and grand parent. store this node as key and value as struct in hash table. -rahul On Tue, Mar 9, 2010 at 7:19 PM, Rohit Saraf wrote: > even simpler.. and lesser space. > > just store in an array the link to all nodes on

Re: [algogeeks] Interview question.Provide the solution as per the constraints.

2010-03-07 Thread Rahul Singh
How about having 2 pointers , from root , one pointer goes twice other goes once. By the time one goes to the leaf node other will be in median. Do DFS or inorder traversal. algo is like: while(leaf incase or pointer 2 is not reached) for(every 1 jump of pointer 1 ) jump pointer 2 twice; } re

[algogeeks] topic:modified Apriori algorithm for taking quantitative input values

2010-03-05 Thread Rahul Kushwaha
modified Apriori algorithm for taking quantitative input values so that the algo takes 1 2 34 45 12 4 44 32 as input instead of 1 1 0 0 1 1 0 0 0 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.

Re: [algogeeks] Alternative Dta Structures for Cache Inefficient Linked Lists

2010-02-18 Thread Rahul Kushwaha
ya i also have thot on the same lines and when the fixed malloc block is full with data we can realloc() any better idea..?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@google

Re: [algogeeks] Ruby on rails help

2009-11-18 Thread rahul rai
hello; can any body give me a link to download to THE SOLUTION MANNUAL TO CLRS ALGORITHMS TEXTBOOK I NEED IT URGRNTLY On 11/18/09, monty 1987 <1986mo...@gmail.com> wrote: > Ye naya Ruby on Rails ka kya funda hai > > On Wed, Nov 18, 2009 at 9:37 AM, nitin mathur > wrote: > >> Hi >> >> Is

[algogeeks] Re: Check divisibility by 3

2009-08-14 Thread Rahul Singhal
meone help ?? > -- > Richa Gupta > (IT-BHU,India) > > > > -- Rahul singhal RnD Engineer Tejas Networks Banglore-09416725998 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algori

[algogeeks] Re: REGULAR & WEEKEND CORPORATE TRAINING BATCHS on Java/J2ee, Struts, EJB, Hibernate, XML for FRESHE R’S, B.E/B.Tech, MCA, M.Tech, M.Sc, BCA, B.Sc.

2009-04-29 Thread Rahul Kushwaha
hello dear, i just wanted to ask if your company provides training in delhi also. Reply as soon as possible 2009/4/27 ravi > > Our company is a corporate training and resource provider company > based in Bangalore. we are in to the field of corporate training > recently we are providing traini

[algogeeks] Re: find the output

2009-01-07 Thread Rahul Kushwaha
this code produces DANGLING REFERENCES coz buffer points to a location that does not exist \after execution of return statement... On Tue, Jan 6, 2009 at 2:48 AM, tania hamid wrote: > > > Plz indicate the output of the following code and explain why is it so.. > > > *char *modify (char *s) >

[algogeeks] Re: Lucky numbers

2009-01-07 Thread Rahul Kushwaha
can anybody tell me which is best and correct solution On Tue, Jan 6, 2009 at 12:30 AM, Karthik Singaram Lakshmanan < karthiksinga...@gmail.com> wrote: > > Its not clear that just a primality test would close the deal...The > sequence 1,3,7,13...does not have 5 which is prime. > If you consider a

[algogeeks] Re: Backtracking algorithm

2008-11-04 Thread Rahul Singhal
ing algorithm to include into > a program and I don't nkow where find these. > > Someone have any document, or URL to indicate to me ? > > Sincerely, > > > Luciano Soares Pinheiro Jr. > Analista desenvolvedor Sr. > > >

[algogeeks] Re: Operating System

2008-06-05 Thread Rahul Singhal
hey, i also want solution On Thu, Jun 5, 2008 at 6:11 PM, Pratyush <[EMAIL PROTECTED]> wrote: > > Does anybody know if there is a reference manual or solutions to the > exersises to The Design of the Unix Operating Systems by Maurice J > Bach. > > > -- Rah

[algogeeks] Re: linear time to determine cyclic strings...

2007-11-29 Thread rahul
This seems to be a homework problem! Well you could search for the pattern T' in string TT. TT = ARCARC T' = ARC search for T' in TT, if it exists then T' is a cyclic rotation On Nov 28, 11:23 am, "Anupama Murthi" <[EMAIL PROTECTED]> wrote: > Hi all, > linear time to determine cyclic strings... g

[algogeeks] cormen solutions

2007-09-01 Thread rahul
can neone give me link to cormen solutions pls its very urgent pls give me link at [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algo

[algogeeks] How to merge two unsorted single linked list to get a sorted list

2006-05-22 Thread Rahul K
: UHX8kgwAAADkFNoUZvMx0JGQVVIjTHa3 Received: from 155.35.46.12 by y43g2000cwc.googlegroups.com with HTTP; Mon, 22 May 2006 14:04:25 + (UTC) From: "Rahul K" <[EMAIL PROTECTED]> To: "Algorithm Geeks" Subject: How to merge two unsorted single linked list to get a sorted list Date:

[algogeeks] How to Sort a Stack in ascending order

2006-05-04 Thread Rahul K
Given a stack how can I sort it in ascending order. No assumption are to be made about the implementation of the stack. The only functions available are push(), pop(), top(), isEmpty(), isFull(). A optimized solution is highly appreciable. --~--~-~--~~~---~--~~ Yo

<    4   5   6   7   8   9