Re: [algogeeks] Which Data Structure to use

2014-04-15 Thread Narsimha Raju
*[locale]*); } return toReturn; } - similarly for other combinations --- -- Abhay Prakash IV Year (B.Tech + M.Tech Dual Degree) Computer Science And Engineering Indian Institute of Technology, Roorkee. On Fri, Apr 11, 2014 at 10:34 AM, Narsimha Raju cnarsimhar

[algogeeks] Which Data Structure to use

2014-04-10 Thread Narsimha Raju
need to show the result which satisfy all the 3 conditions. 2. Politics, Hyderabad In this case we need to show all the results of politics Hyderabad irrespective of language. -- Regards, C. Narsimha Raju -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] Re: Queue problem

2012-07-24 Thread Priyanka Raju
The answer is single queue... If we fill the queue fully and then dequeue and try again to enqueue... We will get the error.. This is because when we dequeue,we move the front pointer of the queue but not the rear pointer.. But enqueue is at rear end.. The condition for enqueue also checks the

Re: [algogeeks] Re: FACEBOOK ONLINE CODING ROUND

2011-10-24 Thread raju
@icy It's still there except that you'll get a different question. That page promises you a telephone interview if you solve the challenge but I don't know how true that is for non-US guys .. i solved one question two weeks back .. and no one contacted me till now .. ~raju On Tue, Oct 25, 2011

[algogeeks] Citrix Interview Questions ???

2011-10-04 Thread raju
hi all , can anyone pls share citrix interview questions ... thanks raju -- 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] Amazon - array problem

2011-09-30 Thread raju
@nitin .. Output array is not a new array ... you can do anything to input array .. ~raju On Fri, Sep 30, 2011 at 1:24 PM, Nitin Garg nitin.garg.i...@gmail.comwrote: Can we assume the output array is a new array and we can distort the originial array??? On Fri, Sep 30, 2011 at 9:14 AM

[algogeeks] BST to DLL spirally

2011-09-27 Thread raju
Had this question been already discussed .. someone pls give me the algo/logic. Given a Binary Tree, Convert it into Doubly Linked List where the nodes are represented Spirally. For Example :- A B C ABCGED || ACBDEG D E G ~raju -- You received this message because you

Re: [algogeeks] Re: BST to DLL spirally

2011-09-27 Thread raju
using two stacks or using a queue and a stack ... these are obvious solutions .. Just want to know if there exists an iterative way without extra space !!! I should've mentioned these details earlier .. sorry for that !! ~raju On Tue, Sep 27, 2011 at 10:09 PM, geeks ankurshukla.h...@gmail.com

Re: [algogeeks] Re: Modified binary search

2011-09-27 Thread raju
Rotated array = [ 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0 ] find 1 using binary search ... turns out we cant use binary search if we've repeated elements in rotated array ... ~raju On Tue, Sep 27, 2011 at 8:18 PM, akanksha akanksha.271...@gmail.com wrote: /* A program in which an array have

[algogeeks] Amazon online test

2011-09-23 Thread raju
hi all, can anyone pls share the questions amazon has been asking in online written tests. thanks raju -- 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: 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;

[algogeeks] Re: need explanation of this c code

2011-09-04 Thread raju b
yes..you are right ..sukaran...that is depends on compiler which one we are using...6/5 or 6/6 only two possibilities come but answer will come 2 only for this qn on every compiler.. .. On Sep 4, 8:22 pm, sukran dhawan sukrandha...@gmail.com wrote: order of evaluation for such expressions is

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 to

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]

2011-08-10 Thread Raju Yadav
void mirror(struct node* node) { if (node==NULL) { return; } else { struct node* temp; mirror(node-left); mirror(node-right); temp = node-left; node-left = node-right; node-right = temp; } } -- You received this message because you are subscribed to the

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

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]

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. To

[algogeeks] BST Question

2010-10-13 Thread Narsimha Raju
HI A BST is given you need to print all the negative numbers. Sol: Inorder traversal will work. but i want to ignore the right sub trees based on the value at the root. (i.e efficient sol) -- Regards, C. Narsimha Raju MS, IIIT Hyderabad. http://research.iiit.ac.in/~narsimha_raju

Re: [algogeeks] Re: ALgo help pls

2010-09-22 Thread Narsimha Raju
/algogeeks?hl=en. -- Regards, C. Narsimha Raju MS, IIIT Hyderabad. http://research.iiit.ac.in/~narsimha_raju/ -- 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

Re: [algogeeks] Array Good One!!!!!!!!!!!!!!!!!!!!!!

2010-09-19 Thread naga raju
Handling ' 0 's Case1: array containing single zero. Caae 2: array containing multiple zeros. int numberofZeros =0, index =0 ; before[0]=1 after[length-1]=1; for (int i=1; ilength;i++) { if( !a[i] ) //encountered zero { numberofZeros++; if(numberofZeros == 1) index =i; //Case1