[algogeeks] Amazon problem

2013-06-11 Thread Jai Shri Ram
Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region . For example, X X X X X O O X X X O X X O X X After running your function, the board should be: X X X X X X X X X X X X X O X X --

[algogeeks] Intrestting problem

2013-06-11 Thread Jai Shri Ram
Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region . For example, X X X X X O O X X X O X X O X X After running your function, the board should be: X X X X X X X X X X X X X O X X --

Re: [algogeeks] Re: Anagrams

2011-11-30 Thread Ram Pangeni
WELL PLACED BALLS There are W identical white balls, B identical black balls and C containers. We need to distribute all the balls into some of the containers. A selection is done by randomly picking a container followed by randomly picking a ball in it. We need to maximise the probability of

Re: [algogeeks] address calculation

2011-08-06 Thread Ram Chauhan
1049 and 1098 On Sat, Aug 6, 2011 at 11:09 PM, aditi garg aditi.garg.6...@gmail.comwrote: CHAR A[10][15] AND INT B[10][15] IS DEFINED WHAT'S THE ADDRESS OF A[3][4] AND B[3][4] IF ADDRESS OF A IS OX1000 AND B IS 0X2000 -- You received this message because you are subscribed to the Google

Re: [algogeeks] Error in code?plz help...

2011-08-06 Thread Ram Chauhan
Lvalue assigment error. On Sat, Aug 6, 2011 at 4:05 PM, Rajesh Kumar testalgori...@gmail.comwrote: How to remove error in this code? #includestdio.h main() { int i=10,j=15; if(i%2=j%3) printf(\ncharacter); } -- Regards Rajesh Kumar -- You received this message because you are

Re: [algogeeks] latest google interview questions

2011-08-02 Thread Ram CEG
funny:) On Wed, Aug 3, 2011 at 1:25 AM, UTKARSH SRIVASTAV usrivastav...@gmail.comwrote: hi I got intern in google ...but i was not able to do some question of written paper 1. main() { printf(hello); } OUTPUT- hello Why the output is coming hello? 2. Who developed C

Re: [algogeeks] what wil be o/p

2011-08-02 Thread Ram CEG
array size is 5. so 5*4(size of int)=20. On Wed, Aug 3, 2011 at 1:45 AM, Anuj kumar anonymize...@gmail.com wrote: #includestdio.h #includeconio.h int main() { int arr[5]; printf(%d %d\n,sizeof(arr),sizeof(arr)); getch(); return 0; } o/p 204 anybody can tell me how 20

Re: [algogeeks] Re: Is it possible to determine an n-ary tree nodes depth given its index?

2011-08-01 Thread Ram Shankar
this group at http://groups.google.com/group/algogeeks?hl=en. -- Cheers, Ram -- 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] Re: wht is d logic behind this

2011-07-29 Thread Ram CEG
kadane's algo...google it On Fri, Jul 29, 2011 at 12:52 PM, SAMMM somnath.nit...@gmail.com wrote: Do u want the subarray consisting of consecutive elements ??? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

Re: [algogeeks] Re: Nagarro Coding Round Ques......

2011-07-27 Thread Ram CEG
checking for anagrams itself will work for this question... by using an array[[256]; On Wed, Jul 27, 2011 at 2:52 AM, SkRiPt KiDdIe anuragmsi...@gmail.comwrote: I dint get wat are you speaking of.each alphabet is mapped onto ascii_val-'a' ie ascii of a=97. now check for odd and even occurence

Re: [algogeeks] C Output

2011-07-26 Thread Ram CEG
op:abc.. \c is not an escape sequence On Tue, Jul 26, 2011 at 10:17 PM, aditi garg aditi.garg.6...@gmail.comwrote: what will be the output fr this?? printf(ab\c); On Tue, Jul 26, 2011 at 6:22 PM, swetha rahul swetharahu...@gmail.comwrote: Dipankar, Thanks!!! On Tue, Jul 26, 2011 at

Re: [algogeeks] C Output

2011-07-26 Thread Ram CEG
ya it would ignore \ alone.. On Tue, Jul 26, 2011 at 10:27 PM, aditi garg aditi.garg.6...@gmail.comwrote: ya thats wat my doubt was...if its not a recognised escape sequence thn how is it interpreted?? Would the compiler jst ignore ''\''? On Tue, Jul 26, 2011 at 10:25 PM, Ram CEG honest

[algogeeks] Re: Find valid anagrams

2011-07-21 Thread Ram CEG
#includeiostream using namespace std; int main() { char s[100]; gets(s); coutsendl; int a[256]={0}; char *ptr=s; while(*ptr!='\0') { a[(int)*ptr]+=1; ptr++; } char s1[100];

[algogeeks] Re: Find valid anagrams

2011-07-21 Thread Ram CEG
this find whether two strings are anagrams! -- 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] How to design Elevator Control system ?

2011-07-19 Thread Ram CEG
ya it depends on an individual's visualisation... On Wed, Jul 20, 2011 at 1:59 AM, radha krishnan radhakrishnance...@gmail.com wrote: i think we should not use the answer from otherr ppl for these type of questions ! This is design ! we have to think of ur own :P -- You received this

Re: [algogeeks] Fwd: Fw: Fwd: : PLEASE SIGN AND FORWARD!!! *

2011-03-15 Thread Vijay Ram Chitrapu
On 16/03/2011, arjoo kumar 2009ar...@gmail.com wrote: arjookumar2009ar...@gmail.com On 3/13/11, Srinivas Baravatula prodi...@gmail.com wrote: -- Forwarded message -- From: ZEAL DECESSUS zealg...@gmail.com Date: Sun, Mar 13, 2011 at 12:15 PM Subject: Fwd: Fw: Fwd: : PLEASE

Re: [algogeeks] Re: how we can access 2nd element of an struct

2010-09-09 Thread ram das
. -- Thanks Regards Ram Narayan Das mob: +91 9177711195 -- 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

[algogeeks] how we can access 2nd element of an struct

2010-09-07 Thread ram das
how we can access 2nd element of an struct defined as struct { int a; flaot b; } we have given a void pointer of this struct. we dont know what is the structre only knows 2nd element is a flaot type. -- Thanks Regards Ram Narayan Das mob: +91 9177711195 -- You received this message because

Re: [algogeeks] linked list

2010-08-20 Thread ram das
, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanks Regards Ram Narayan Das mob: +91 9177711195 -- 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

Re: [algogeeks] linked list

2010-08-19 Thread ram das
. 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 Ram Narayan Das mob: +91 9177711195 -- You received this message

Re: [algogeeks] linked list

2010-08-19 Thread ram das
%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanks Regards Ram Narayan Das mob: +91 9177711195 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] 0's and 1's yet again!!!

2010-08-19 Thread ram das
. -- Thanks Regards Ram Narayan Das mob: +91 9177711195 -- 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

Re: [algogeeks] 0's and 1's yet again!!!

2010-08-19 Thread ram das
; } } } On Thu, Aug 19, 2010 at 7:00 PM, ram das ramnaraya...@gmail.com wrote: shiftZeroOne(int *arr,int size) { int odd=1,even=0; while(odd = size even =size) { if ( arr[even] != 1 ) even+=2; if ( arr[odd] != 0 ) odd

[algogeeks] Longest Bitstring with equal 0s and 1s

2010-08-01 Thread Ram Kumar
Given an array of 0s and 1s in any order, find the longest sequence that has equal number of 0s and 1s. 0 0 0 0 1 1 1 1 0 0 //array 0 1 2 3 4 5 6 7 8 9 //index ans1 (0,7) ans2 (1,8) ans3 (2,9) all having 4 0's and 4 1's -- Regards, Ramkumar.G -- You received this message

[algogeeks] Amazon question

2010-07-31 Thread Ram Kumar
Consider there are N players who have a round robin tournament. input is a data structure which says who won the match for every pair i , j i != j . write an algo to give a sequence A[1...n] such that for ever i , i th player lost to i+1 th player and won against i-1 th player. -- Regards,

Re: [algogeeks] number of BST's

2010-07-31 Thread Ram Kumar
The question is to find the no of structures possible for a BST which is directly given bycomputing the catalan number for n(no of nodes) -- 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] Amazon Placement Question

2010-07-30 Thread Ram Kumar
DONT DO A BFS!! NOT WORTH IT! CALL THE NEW POINTER AS 'SIDE' POINTER. for every root connect its left and right, for every root connect root-right and root-SIDE-left that ll do -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

Re: [algogeeks] number of BST's

2010-07-30 Thread Ram Kumar
@sharad BST is not unique, anyway the formula is correct -- 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

Re: [algogeeks] number of BST's

2010-07-30 Thread Ram Kumar
@abaove : sorry the formula stated prev is wrong. is (2n Cn)/(n+1) or (2n!)/(n+1)!*n! both being the same. refer catalan numbers -- Ramkumar.G -- 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] c array

2010-06-13 Thread ram
] On Behalf Of Rohit Saraf Sent: 13 June 2010 08:19 To: algogeeks@googlegroups.com Subject: Re: [algogeeks] c array @ram : i guess you have used some longer string and not strings btw.. what is Mingw ? gcc/g++ is not mingw, i guess -- Rohit

RE: [algogeeks] c array

2010-06-12 Thread ram
not eight ;hence the error -- ram From: algogeeks@googlegroups.com [mailto:algoge...@googlegroups.com] On Behalf Of sharad kumar Sent: 13 June 2010 07:59 To: algogeeks@googlegroups.com Subject: Re: [algogeeks] c array hey array indexing starts from 0 rite?? then y shld u get overflow in first