e 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.
>
--
Thanks & Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Science & Engineering,
Nati
; For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
Thanks & Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Science & Engineering,
National Institute Of Technology,Durgapur
India
http://priyanka-nit.blogspot.com/
--
gt;> 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.
>>>>>
>>>
ks" 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?hl=en.
>
--
Th
...@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.
>
>
--
Thanks & Regards,
Priyanka Chatterjee
Final Year Undergradua
sorry please discard the above mail
On 13 September 2010 21:11, Priyanka Chatterjee wrote:
>
> http://xrds.acm.org/
>
> http://www.comp.nus.edu.sg/~stevenha/programming/acmoj.html
> http://www.uvatoolkit.com/problemssolve.php
>
> Thanks & Regards,
> Priyanka Chatterje
http://xrds.acm.org/
http://www.comp.nus.edu.sg/~stevenha/programming/acmoj.html
http://www.uvatoolkit.com/problemssolve.php
Thanks & Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Science & Engineering,
National Institute Of Technology,Durgapur
India
http://
bscribe 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.
>
>
--
Thanks & Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Scien
find
the given sum.
--
Thanks & Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Science & Engineering,
National Institute Of Technology,Durgapur
India
http://priyanka-nit.blogspot.com/
--
You received this message because you are subscribed to the Google Group
@Algoboy , its pretty difficult to find the duplicate in constant space
unless u mention the range of numbers. Do the numbers lie between [1,n] ???
Unless some other information is given i don't think it is possible to come
out with a proper solution.
>
--
Thanks & Regar
o DLL is a simple algo,
already discussed)
T(n)=O(n) , S(n) =O(1). The only problem is you change the structure .
(There probably exists a working algo to convert a DLL to BST , i haven't
tried that yet although)
--
Thanks & Regards,
Priyanka Chatterjee
Final Year Undergraduat
ve from your queue do connect these nodes till your
>>> count. You may need to use one more temp variable to not to lose the
>>> previous level node count when you compute the next level node count.
>>> Repeat the same for all the level.
>>>
>>> RK
>>&g
On 30 July 2010 02:59, Priyanka Chatterjee wrote:
> Algo: 1. find height of tree
> 2. do level order traversal
> i> at each level store the address of each tree node in the
> data part of a linked node and form linked list of the nodes
> ii>
gt;next=levelOrderTraversal(root->right,level-1);
}
return ptr;
}
struct linkNode * createLinkNode(struct node * root){
struct linkNode* newNode=(struct linkNode*) malloc(sizeof(struct linkNode));
newNode->data=root;
newNode->next=NULL;
}
--
Thanks & Regards,
Priyanka Cha
void kSmallestBST(struct node * root,int k){
static int count=0;
if(!root) return;
kSmallestBST(root->left,k);
if(++count==k) {cout<data; return;}
kSmallestBST(root->right,k);
}
--
Thanks & Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Science
tr2-> data ) ptr1= ptr1->next;
> else if ((ptr1->data + ptr2-> data ) == k){
> print_data_of_ptr1_and_ptr2;
> ptr2= ptr2->prev;
> ptr1= ptr1->next;
> }
> }
>
>
> the 2nd step will take O(n) time.No
and O(1) space.
>
>
> --
> Thanks & Regards,
> Priyanka Chatterjee
> Final Year Undergraduate Student,
> Computer Science & Engineering,
> National Institute Of Technology,Durgapur
> India
> http://priyanka-nit.blogspot.com/
>
--
You received this message because y
ards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Science & Engineering,
National Institute Of Technology,Durgapur
India
http://priyanka-nit.blogspot.com/
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To
>
> @Anand- your code wont work for the test case {1,1,1,2}
>
Although few trivial test cases it could crack but the boundary ones
failed. Can you please explain what exactly you tried to do , your algorithm
is not clear.
--
Thanks & Regards,
Priyanka Chatterjee
Final Year
;
> to be honest, i hate to ask or be asked such question in interviews :)
>
> Best Regards
> Ashish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
>
> On Thu, Jul 8, 2010 at 9:53 PM, Priyanka Chatterjee
> wrote:
>
&g
solution? What if our target?
>>>
>>> If a solution is required simple, then as mentioned by Satya, sort the
>>> numbers in O(nlogn) time and scan once in O(n) time. So we get the
>>> number repeated 3 times in O(nlogn) time and O(1) space.
>>>
>
ish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
>
> On Thu, Jul 8, 2010 at 1:32 PM, Priyanka Chatterjee
> wrote:
>
>>
>>
>> I totally agree with Umesh's algo which gives O(K+1) time and an inplace
>> solution
I totally agree with Umesh's algo which gives O(K+1) time and an inplace
solution. The only point is the first K+1 numbers may get negated and the
array is modified. In that case after finding the duplicate we can traverse
the array again for the first k+1 no.s and make the negative numbers
positiv
y fails if more than one no. repeats once.
Thanks & Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Science & Engineering,
National Institute Of Technology,Durgapur
India
http://priyanka-nit.blogspot.com/
--
You received this message because you are subscribed to
3 gives the corresponding no. repeating thrice. -O(N)
>
> Time complexity is O(N+M) . Linear
> space complexity is O(M) to store binary form.
>
> But this algo certainly fails if more than one no. repeats once.
>
>
>
--
Thanks & Regards,
Priyanka Chatterjee
Final Year U
Firstly it is srm 475, the following link has the problem
http://www.topcoder.com/stat?c=problem_statement&pm=10878&rd=14156
@crazysaikat : Sorry for misconstruing you. As this group is public it is
better not to post problems of a srm while it is running.
Apart from discussing it here, if you nee
t;
> "WWB"
> 2
> Returns: 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
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?hl=en.
>
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
> ht
s.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.
>
>
--
Thanks & Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Co
On 29 June 2010 20:31, Priyanka Chatterjee wrote:
>
>
>
>> int add(int a, int b)
>> {
>> do
>> {
>> a=a^b;// sum without carry
>> b=((a^b)&b)<<1;// carry without addition
>&g
nd b are different.
so this is clearly XOR operation
2. if we want carry only , then bit[k]=1 in result only if bit[k-1]=1 in
both a and b => (1 &1)<<1=10 , so this operation is AND followed by LEFT
SHIFT.
3. finally the loop ends when b=0 => iterate until nothing to carry
XOR all the elements of array, the remaining value is the required unique
number.
(XORing two same numbers results in zero)
>
>
--
Thanks & Regards,
Priyanka Chatterjee
Third Year Undergraduate Student,
Computer Science & Engineering,
National Institute Of Technology,Durga
t;>>>> Also you might like to refer to Red Black Trees in CLRS that
>>>>>>>> chapter explains rotations.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Rohi
roups.com
>>>>>> .
>>>>>> For more options, visit this group at
>>>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribe
ng
IIT Bombay
http://www.cse.iitb.ac.in/~rohitfeb14<http://www.cse.iitb.ac.in/%7Erohitfeb14>
On Sun, Apr 11, 2010 at 11:00 AM, Priyanka Chatterjee
wrote:
>
>>
>>
>> On 11 April 2010 10:46, Rohit Saraf wrote:
>>
>>> Construct a binary tree from the dat
gorithm 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
then binary search for x1 and x2 in
O(logn) will be less efficient than the simple solution of O(n). Think on
the data structure that can optimize it.
Is it possible in time complexity < O(n)?
>
>
--
Thanks & Regards,
Priyanka Chatterjee
Third Year Undergraduate Student,
Com
Design an efficient algorithm to report all the points within x1 and x2 from
a list of N integers.
What data structure will you use to implement this algorithm?
Find the order of complexity . ( An O(N) solution is not asked)
--
Thanks & Regards,
Priyanka Chatterjee
Third Year Undergrad
in the
worst case?
>
> On Sun, Mar 28, 2010 at 11:33 AM, Priyanka Chatterjee > wrote:
>
>> Design the most efficient algorithm to find the first k smallest elements
>> in an array ?
>>
>> --
>> Thanks & Regards,
>> Priyanka Chatterjee
>&g
Design the most efficient algorithm to find the first k smallest elements
in an array ?
--
Thanks & Regards,
Priyanka Chatterjee
Third Year Undergraduate Student,
Computer Science & Engineering,
National Institute Of Technology,Durgapur
India
http://priyanka-nit.blogspot.com/
--
You
age 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 mor
42 matches
Mail list logo