the rear pointer alone
Thank you
Priyanka
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com
i=i++ + ++i;
j++ + ++j;
k=k++ + k++ + ++k;
All these Statements have compiler Dependent Output, As they violet
sequence point rule ( here value of a variable is modified two or more
times between two successive sequence points.)
Standard does not specify the exact order of execution of these type
;
}
}
}
On Tue, Jan 10, 2012 at 10:42 AM, priyanka jaggi
priyankajag...@gmail.comwrote:
@ankur : in this question, the elements of the array are continuous
i think the solution of shravan reddy is correct and works for negative
nos too.
--
You received this message
@lucifier :
Please tell how you reduce SuperSum ( k, n) into
SuperSum(k,n) = SuperSum (k-1, n) * (n+k) / (k+1)
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
Given an array (length n), we need to find the subarray (length k) such
that the sum of the first j elements of the subarray equals the sum of the
remaining (k-j) elements of the subarray.
For e.g.
Array: 2,2,13,4,7,3,8,12,9,1,5
Output: 4,7,3,8,12,9,1 [4+7+3+8=12+9+1]
Could this be done with a
@ankur : in this question, the elements of the array are continuous
i think the solution of shravan reddy is correct and works for negative nos
too.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
*
*
*#include fstream
#include iostream
using namespace std;
bool flag=false;
void check(int i)
{
int sum=0;
char n[5];
itoa(i,n,10);
for(int j=0;j5 n[j] != '\0';j++)
{
char p = n[j];
sum += atoi(p);
}
if(sum==3 || sum==6 || sum==9)
flag = true;
else if(sum9)
check(sum);
}
void main()
{
int i;
int a,b,max,min;
max=(a+b+abs(a-b))/2;
min=(a+b-abs(a-b))/2;
--
cheers
priyanka
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email
It will work...
a=3
b=-2
max=(a+b+abs(a-b))/2
so
max=(3-2+abs(3-(-2)))/2
=(1+abs(5))/2
=(1+5)/2
=3
Same in case of min
--
cheers
priyanka
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send
11.716 km
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this
How to find the in-order successor of a given node in a binary search tree
where each node has a link to its parent. pl explain logic to solve it..
( Pl dnt give solution of doing in order traversal and storing it in array.)
--
You received this message because you are subscribed to the Google
://groups.google.com/group/algogeeks?hl=en.
--
with regards,
Priyanka Loya
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks
thanks guys..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this
wat about a double ended queue?
cheers
priyanka
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr
clear definition about abstract data type???
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
hai can anybody tell what is abstract datatype clearly??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
1, 2011 at 8:41 PM, Priyanka pril...@gmail.com wrote:
hai can anybody tell what is abstract datatype clearly??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
struct node
{
int d;
struct node *next;
}*top=NULL;
wat s it mean?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
@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.
--
with regards,
Priyanka Loya
--
You received this message because you are subscribed to the Google
tats bcos...
if it is a^21...
it will be (a^21/2)*(a^21/2)*(a^21mod2)
= (a^10)*(a^10)*(a^1)
correct me if i'm wrong
--
cheers
priyanka
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks
write a c program to print the following
*
* *
* * *
* *
*
--
cheers
priyanka
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
@ SkRiPt...
can u pl explain ur ans?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For
if any1 can post Oracle Apps questions.. pl post...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
output of above question will be hello h
In switch we get output until a break statement is encountered..
so after printing hello it will also print h and den dere is a break
statement so it will come out of while loop
--
You received this message because you are subscribed to
can u pl tell wat is dis x y coordinate?
are dey centre coordinates or any point on circumference of circle..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from
is this code running?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options,
Geeks group.
To post to this group, send email to algogeeks@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
.
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/
--
You received
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 Groups
Algorithm Geeks group.
To post to 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/
--
You received this message because you
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://priyanka
sorry please discard the above mail
On 13 September 2010 21:11, Priyanka Chatterjee dona.1...@gmail.com wrote:
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
+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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,
National Institute Of Technology
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 Undergraduate Student,
Computer Science
@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 Regards,
Priyanka Chatterjee
...@gmail.comwrote:
A simple queue implementation will do.
-Regards
Amit Agarwal
blog.amitagrwal.com
On Fri, Jul 30, 2010 at 9:22 AM, Priyanka Chatterjee
dona.1...@gmail.com wrote:
On 30 July 2010 02:59, Priyanka Chatterjee dona.1...@gmail.comwrote:
Algo: 1. find height of tree
,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 Chatterjee
Final Year Undergraduate Student,
Computer Science
On 30 July 2010 02:59, Priyanka Chatterjee dona.1...@gmail.com 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 store
void kSmallestBST(struct node * root,int k){
static int count=0;
if(!root) return;
kSmallestBST(root-left,k);
if(++count==k) {coutroot-data; return;}
kSmallestBST(root-right,k);
}
--
Thanks Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Science Engineering
- data ) == k){
print_data_of_ptr1_and_ptr2;
ptr2= ptr2-prev;
ptr1= ptr1-next;
}
}
the 2nd step will take O(n) time.No added space complexity
On Jul 24, 9:29 am, Priyanka Chatterjee dona.1...@gmail.com wrote:
Given a binary search tree of n
,
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 post to this group, send
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 Groups
Algorithm Geeks group.
To post
solution .
--
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 Groups
Algorithm Geeks group
On Thu, Jul 8, 2010 at 1:32 PM, Priyanka Chatterjee
dona.1...@gmail.comwrote:
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
) space.
Sourav
On Jul 7, 7:36 pm, Priyanka Chatterjee dona.1...@gmail.com wrote:
I am sceptical whether any XOR solution exits for your question. But
if
the question is modified as :
*Only one number repeats once,* some no.s repeat twice and only one
number
repeat thrice, here
@Ashish: i could not get the answer -3 as well . It is indeed a tough
question. :)
On 9 July 2010 10:31, Ashish Goel ashg...@gmail.com wrote:
@Priyanka : using my logic,
2,-3,5,4,1,3...
2,-3,-5,4,1,3..
2,-3,-5,4,-1,3..
-2,-3,-5,4,-1,3..
now -3 implies 3 is the answer
to be honest, i
more help on the problem, you can
access it under competitionsalgorithms statisticsMatch editorials on the
topcoder website. The analysis will be uploaded shortly.
--
Thanks Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Science Engineering,
National Institute
.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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
nothing is wrong.i wrote sorry in my third mail
On 1 July 2010 14:04, anand verma anandandymn...@gmail.com wrote:
@Priyanka.can u plz explain what is wrong in SHRINIVAS'
code??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
On 29 June 2010 20:31, Priyanka Chatterjee dona.1...@gmail.com wrote:
int add(int a, int b)
{
do
{
a=a^b;// sum without carry
b=((a^b)b)1;// carry without addition
} while(b);//when carry equal to 0 a contains
, 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
--
Thanks Regards,
Priyanka Chatterjee
Final Year Undergraduate Student,
Computer Science
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,Durgapur
India
http://priyanka
Bombay
http://www.cse.iitb.ac.in/~rohitfeb14http://www.cse.iitb.ac.in/%7Erohitfeb14
On Sun, Apr 11, 2010 at 11:00 AM, Priyanka Chatterjee
dona.1...@gmail.com wrote:
On 11 April 2010 10:46, Rohit Saraf
rohit.kumar.sa...@gmail.com wrote:
Construct a binary tree from the data
.
--
Thanks Regards,
Priyanka Chatterjee
Third 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 post
and Engineering
IIT Bombay
http://www.cse.iitb.ac.in/~rohitfeb14http://www.cse.iitb.ac.in/%7Erohitfeb14
On Sun, Apr 11, 2010 at 11:00 AM, Priyanka Chatterjee
dona.1...@gmail.comwrote:
On 11 April 2010 10:46, Rohit Saraf rohit.kumar.sa...@gmail.com wrote:
Construct a binary tree from the data (maintain
...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Thanks Regards,
Priyanka Chatterjee
Third Year Undergraduate Student,
Computer Science Engineering,
National Institute Of Technology,Durgapur
India
http
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 Undergraduate
) and 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,
Computer Science Engineering
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 received
time in the
worst case?
On Sun, Mar 28, 2010 at 11:33 AM, Priyanka Chatterjee dona.1...@gmail.com
wrote:
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
.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Thanks Regards,
Priyanka Chatterjee
Third Year Undergraduate Student,
Computer
62 matches
Mail list logo