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
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:
&
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
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
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
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
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
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
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
"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
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
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
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
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
. 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
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
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
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
>
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 ??
>
>
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
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
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.
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
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
-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
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
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
)-
|
^
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
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
@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
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
@ 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
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
@ 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
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
@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
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
"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
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
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
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
> >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
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
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
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
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
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
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 ){
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
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.
@ 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;
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:
>
&
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-
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
/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
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.
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
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
@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
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
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
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
"
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
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
#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
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 ~]
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
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
. 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
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
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
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
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.
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
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
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
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
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)
>
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
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.
>
> >
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
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
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
: 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:
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
801 - 885 of 885 matches
Mail list logo