Re: [algogeeks] Re: Queue problem

2012-07-24 Thread Priyanka Raju
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

Re: [algogeeks] c++_Output

2012-01-21 Thread priyanka jaggi
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

Re: [algogeeks] Re: finding subarray

2012-01-10 Thread priyanka jaggi
; } } } 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

[algogeeks] Re: SuperSum

2012-01-10 Thread priyanka
@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

[algogeeks] finding subarray

2012-01-09 Thread priyanka jaggi
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

Re: [algogeeks] Re: finding subarray

2012-01-09 Thread priyanka jaggi
@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

Re: [algogeeks] Re: adobe written round que

2011-09-17 Thread priyanka raju
* * *#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;

Re: [algogeeks] Re: C Trick

2011-08-24 Thread priyanka raju
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

Re: [algogeeks] C Trick

2011-08-24 Thread priyanka raju
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

Re: [algogeeks] apti! solve this!

2011-08-17 Thread priyanka singhal
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

[algogeeks] TRee question...

2011-08-11 Thread Priyanka Goel
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

Re: [algogeeks] Puzzle

2011-08-04 Thread Priyanka
://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

Re: [algogeeks] Structure

2011-08-02 Thread priyanka pandian
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

Re: [algogeeks] Front/end operations

2011-08-01 Thread priyanka raju
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

[algogeeks]

2011-08-01 Thread priyanka pandian
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

[algogeeks] ADT

2011-08-01 Thread Priyanka
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

[algogeeks] Re: ADT

2011-08-01 Thread Priyanka
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

[algogeeks] Structure

2011-08-01 Thread Priyanka
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

Re: [algogeeks] Re: Novell - Puzzle

2011-07-31 Thread Priyanka
@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

Re: [algogeeks] Re: FB intern

2011-07-31 Thread priyanka raju
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

[algogeeks]

2011-07-31 Thread priyanka raju
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

[algogeeks] NIT Warangal people... can u pl post interview process and questions of Oracle interview....

2011-07-30 Thread Priyanka Goel
-- 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

Re: [algogeeks] puzzle

2011-07-27 Thread priyanka goel
@ 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

Re: [algogeeks] Re: Amazon

2011-07-24 Thread priyanka goel
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

Re: [algogeeks] output plzz

2011-07-23 Thread priyanka goel
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

Re: [algogeeks] Circle Circle more Circles .........

2011-07-19 Thread priyanka goel
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

Re: [algogeeks] Re: how to optimally compute a matrix (nXn) to the power of k?

2011-07-19 Thread priyanka goel
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,

Re: [algogeeks] If anyone have this book please mail me Thanks in advance

2011-05-03 Thread Priyanka Chatterjee
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

Re: [algogeeks] Re: Amazon Question

2011-01-26 Thread 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

Re: [algogeeks] Re: post and pre increment operators

2011-01-08 Thread Priyanka Chatterjee
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

Re: [algogeeks] post and pre increment operators

2011-01-08 Thread Priyanka Chatterjee
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

[algogeeks] uva toolkit

2010-09-13 Thread Priyanka Chatterjee
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

[algogeeks] Re: uva toolkit

2010-09-13 Thread Priyanka Chatterjee
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

Re: [algogeeks] Help with Increment Operators in C!

2010-08-28 Thread Priyanka Chatterjee
+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

Re: [algogeeks] BST Problem

2010-08-06 Thread Priyanka Chatterjee
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

Re: [algogeeks] Find the duplicate

2010-08-06 Thread Priyanka Chatterjee
@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

Re: [algogeeks] Amazon Placement Question

2010-07-31 Thread 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

Re: [algogeeks] Amazon Placement Question

2010-07-29 Thread Priyanka Chatterjee
,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

Re: [algogeeks] Amazon Placement Question

2010-07-29 Thread Priyanka Chatterjee
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

Re: [algogeeks] Find The Kth min in a binary search tree

2010-07-26 Thread Priyanka Chatterjee
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

Re: [algogeeks] Re: BST

2010-07-24 Thread Priyanka Chatterjee
- 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

[algogeeks] BST

2010-07-23 Thread Priyanka Chatterjee
, 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

[algogeeks] Re: BST

2010-07-23 Thread Priyanka Chatterjee
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

Re: [algogeeks] microsoft.

2010-07-08 Thread Priyanka Chatterjee
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

Re: [algogeeks] microsoft.

2010-07-08 Thread Priyanka Chatterjee
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

Re: [algogeeks] Re: adobe problem---array

2010-07-08 Thread Priyanka Chatterjee
) 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

Re: [algogeeks] microsoft.

2010-07-08 Thread Priyanka Chatterjee
@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

Re: [algogeeks] Re: Need help

2010-07-07 Thread Priyanka Chatterjee
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

Re: [algogeeks] Need help

2010-07-06 Thread Priyanka Chatterjee
. 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

Re: [algogeeks] addition using bitwise

2010-07-01 Thread Priyanka Chatterjee
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

Re: [algogeeks] addition using bitwise

2010-06-29 Thread Priyanka Chatterjee
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

Re: [algogeeks] addition using bitwise

2010-06-29 Thread Priyanka Chatterjee
, 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

Re: [algogeeks] unique number in an array

2010-06-15 Thread Priyanka Chatterjee
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

Re: [algogeeks] First k smallest elements

2010-04-13 Thread Priyanka Chatterjee
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

Re: [algogeeks] First k smallest elements

2010-04-11 Thread Priyanka Chatterjee
. -- 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

Re: [algogeeks] First k smallest elements

2010-04-11 Thread Priyanka Chatterjee
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

Re: [algogeeks] First k smallest elements

2010-04-11 Thread Priyanka Chatterjee
...@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

[algogeeks]

2010-03-31 Thread Priyanka Chatterjee
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

Re: [algogeeks]

2010-03-31 Thread Priyanka Chatterjee
) 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

[algogeeks] First k smallest elements

2010-03-28 Thread Priyanka Chatterjee
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

Re: [algogeeks] First k smallest elements

2010-03-28 Thread Priyanka Chatterjee
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

Re: [algogeeks] Interview question.Provide the solution as per the constraints.

2010-03-08 Thread Priyanka Chatterjee
. 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