@sharad...well said :)
--
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,
when arrays are passed as arguments to a function,the starting address of
the array is passed like a pointer,
thus sizeof(arr)=2..thus 2/2=1..this is the precise reason for always
specifying the column length in the definition of function when functions
have arrays as one of the arguments..
Hope
@Apporve... yeah u r right :)sizeof ptr is always 2 in 16 bit compilers,
i.e, the sizeof an address is 2.and the sizeof(int)=2..i.e
sizeof(*arr)=2..hope u got it now..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
will this work...
int x= 127; //in binary it is interpreted with MSB set to 0.. and all
other bits to 1
temp=xinput;
temp will have the MSB unset..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
@amir hossein...
Can u pls elaborate on the binary search...i donot have that much of a
knowledge about hexadecimal representation of numbers..kindly pls help me..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
void kthsmallest(Tree *node,int k)
{
static int count=0;
if(node!=NULL count!=k)
{
kthsmallest(node-left);
printf(\nKth Smallest - - %d\n,node-data);
kthsmallest(node-right);
}
}
--
You received this message because you are subscribed to the Google Groups
no just a BT, the tree can be in any form..it need not be balanced 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 to
@jalaj: could u pls elaborate on that a bit more..will it have the
complexity of O(n logn logn), and also can u provide the pseudocode pls..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
@jalaj..thanks for ur help..really appreciate it.. :)
--
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
@ashish..nice code..i think the complexity is O(n logn ) right.. am i
right??
--
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
@Anand...for better efficiency..we can find the pivot as a random
integer..for better worst case complexity..
--
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
do the level order traversal of the binary tree and keep the count of the
stack...thats the width of the tree..
--
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
the number of unique binary trees which can be formed with n nodes is
(2^n)-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
find the middle of the list and make it as the root..thus i this maner u
will get a balanced tree..
--
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
int count(int node)
{
int sum=0;i,left,right;
for(i=0;inode;i++)
{
left=count(node-1);
right=count(node-i);
sum+=left*right;
}
return(sum);
}
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
consider the test case of...
1 2 3 1...
1 repeated n/2 times and 2,3 are distinct n/2 elements
for this the algo will not work
--
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.
the solution elegant..but is there any on the fly method by just exploiting
the BST propertyby using left and right 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.
no the array is unsorted..
On Thu, Aug 5, 2010 at 9:29 PM, dinesh bansal bansal...@gmail.com wrote:
If I understand the question correctly... there is an array of size n which
has n/2 distinct elements and one element is repeated n/2 times.
For e.g.:
n = 4: 1 2 3 3
n = 61 2 3 4
will this work in two sorted arrays of equal length..
--
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
hi anand.. can u write up a pseudocode of ur algorithm using XOR logic
--
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
i kinda understood ...u are doing xor on the array twice..but it dint seem
to work for the array..{2,1,3,2}
please elaborate ur code...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
The thread is waiting for u anand :)..reply soon
--
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
where is it amit... could u pls post the link pls..
--
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
@priyanka i agree with u... but wat i thot was if v had a tree with
parent pointers...we can have one pointer at the left most and another at
the rightmost subtree respectivelyand move along the pointers..
I need ur discussion on thisi think the implementation wud be
hey wait a sec,.. we wont be given the k value..
--
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
Reversing and then again reversing the answer will not be an efficient
algorithm...
on the fly computation of sum must be done...any ideas
On 8/14/10, Rahul Singhal nitk.ra...@gmail.com wrote:
I men to say ki just traverse from last instead of reversing it and storing
result in a stack in
@Dave..Can u provide a small snippet for ur explanation pls..
--
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
Tree *node
for(i=1;i=height;i++)
{
levelorder(node,i);
}
void levelorder(Tree *node,int level)
{
if(level==1)
printf(node-value);
else
levelorder(node-left,level-1)
levelorder(node-right,level-1);
}
--
You received this message because you are subscribed to the Google
@apporve ..can u pls elaborate on that ..also on the square root of a
number..
--
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
can anyone say how to calculate the complexity of a recurrence relation
--
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
is it possible to do without any extra space...
--
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
@sathiah..i can get u ..but dont seem to understand the part where in we
must keep track of the 1's...can u pls post the code..
--
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
it will never print..and @ above..the != will never be evaluated ..because
of the short circuiting
--
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
the running time of the algo would be exponential.you need to permute the
array with different combinations of the operators..
i can help you with the code for permuting an array.. i hope u get my
point..
--
You received this message because you are subscribed to the Google Groups
Algorithm
it is compiler dependant da..the evaluation of this kind of expressions
--
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
@rahul...well i thought..we must employ backtracking..can u pls suggest a
recurrence relation for ur DP
--
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
this question can be sovled very easily
1.jus sum the given array...x
2.sum the squares of the given array..y
3.now use the AP.n(n+1)/2..for n=100
4.similarly compute n(n+1)(2n+1)/6 for n =100..
Now solve these eqns ...u get the missing and the dupicate..
--
You received this message
trie will be the best choice for this..
--
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
Hi
Enigma - Online puzzle championship organised by Kurukshetra, international
tech fest of anna university under the patronage of UNESCO.
So what u guys waiting for, exciting prizes are awaiting you.
www.enigma.kurukshetra.org.in
Regards,
Enigma Team
+91 9940014458
--
You received this
39 matches
Mail list logo