selecting pivot as a near median using order stastics method(O(n)) we can
run it in worst case O(nlogn)
--
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
void main(int arg,char *argc)
{
char *s=argc[1];
int count=0,i;
for(i=strlen(s)-1;i=0;i--)
{
count++;
printf(%c,s[i]);
if(count==3)
{
count=0;
putchar(',');
}
}
}
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
it takes O(n) and also O(n)extra space(queue)
On Wed, Dec 22, 2010 at 12:37 PM, Saurabh Koar saurabhkoar...@gmail.comwrote:
Find the first node whose left child is NULL or Right child is NULL
using BFS.(As the tree is complete,all nodes before this will have two
children).Insert at that node.
count the no of bits lets say n
then answer becomes 2^n-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
prims check for this case [1,1,4,4]
--
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
i did nt get this xor part in adithya solution
check if this works
array is valid if satisfy 2 conditions
1.max-min=n-1
2.there should be no repeatations
first one can be done in O(n)
for second
check 1xor2xor...xorn=(a[1]-min+1)xor(a[2]-min+1)xor..
if both are equal there are
sort the jobs according to their starting time and check wheather a job
starting time is less than its previous job ending 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.
@rashmi u missed p7 i took it as 2
--
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
@ravindara yeah this works perfect
--
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
@preethika bettter to do it while inserting itself
--
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
u check only that element and continue inserting other elements
ex m=4
elements
5 3 2 7 1 2 ...
(3,1) will be found while inseting 1 , not 3
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
@preethika (3,1) is found while inserting 1 and (2,2) will be found while
inserting second 2 (which is at last position)
--
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
12 matches
Mail list logo