Re: [algogeeks] MS Q: how to test a driverless car?

2012-06-08 Thread Ashish Goel
Things like sensor data coming from CAN/MoST from the car is collected and analysed in real time to avoid collisions, off-lane movement, distance maintenance, auto parking(including parallel), slippage on road/snow, GPS integration for perfect location and location specific data (like

Re: [algogeeks] MS Q: how to test a driverless car?

2012-06-07 Thread Umer Farooq
What are the specs of the car. Can you please give the answer to the following clarifying questions: - How much distance is it suppose to travel without the driver? - Is it suppose to run on smooth roads only or can it also run on roads with jumps on it? On what type of road is the car most

[algogeeks] MS Q: how to test a driverless car?

2012-06-06 Thread Ashish Goel
Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 -- 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

Re: [algogeeks] MS Q

2012-05-22 Thread Ashish Goel
// countIslands.cpp : Defines the entry point for the console application. // #include stdafx.h const int rows = 5; const int cols = 6; bool visited[rows][cols] = {0}; int arr[rows][cols] = { 0,0,0,0,1,1, 0,1,0,0,0,1, 1,1,0,0,0,0, 1,0,0,0,1,1, 0,0,1,0,1,0}; void initialize() { for (int i=0;

Re: [algogeeks] MS Q

2012-01-10 Thread atul anand
@Ramakant : for which test case your code would fail?? On Tue, Jan 10, 2012 at 1:04 PM, Ramakant Sharma ramakant...@gmail.comwrote: @atul: no..my approach was wrongwe have to check recursively...as sravan said -- You received this message because you are subscribed to the Google

Re: [algogeeks] MS Q

2012-01-10 Thread atul anand
@Ramakan: for j=0 to col arr[0][j]=0; for i=0 to rows arr[i][0]=0; assuming that given matrix is surrounded by 0 i.e indexs (i,j) for arr[][] will start from i=1 = row and j=1 = col. i guess your approach will work. -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] MS Q

2012-01-10 Thread Ramakant Sharma
0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 1 1 -- 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] MS Q

2012-01-10 Thread Ashish Goel
i liked the solution given by the reference i have provided. The thought process is similar to mazing problem given in horowitz sahani. nice question, however, how can this be an interview question? If you give this solution, the interviewer would understand that you knew the problem and hence

Re: [algogeeks] MS Q

2012-01-10 Thread Ramakant Sharma
@atul: 0 0 0 0 0 0 --0 1 0 0 1 0 count=2 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 --0 1 1 1 1 1 count=2 (will not change) but there is only one islandso it wouldnt work... am i right? -- You received this message because you are subscribed to the Google Groups

Re: [algogeeks] MS Q

2012-01-10 Thread atul anand
@ Ramakant : yupwont work. On Tue, Jan 10, 2012 at 7:28 PM, Ramakant Sharma ramakant...@gmail.comwrote: @atul: 0 0 0 0 0 0 --0 1 0 0 1 0 count=2 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 --0 1 1 1 1 1 count=2 (will not change) but there is only one

Re: [algogeeks] MS Q

2012-01-10 Thread atul anand
@ Ashish : abt the solution given by reference. well sometimes it depends , interviewer may take it +vely as he can see you are keen to learn abt different algorithm dats why you knw it... On Tue, Jan 10, 2012 at 7:28 PM, Ashish Goel ashg...@gmail.com wrote: i liked the solution given by the

[algogeeks] MS Q

2012-01-09 Thread Ashish Goel
there is a matrix of 1 and 0 1 is a island and 0 is water 1-1 together makes one island calculate total no of islands Best Regards Ashish Goel Think positive and find fuel in failure -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to

Re: [algogeeks] MS Q

2012-01-09 Thread Ankur Garg
Can you give an example Say matrix is 1 1 0 0 1 1 0 0 0 0 1 1 Has it got 3 islands i.e 1-1 be in same row or they can be column wise also i.e. 5 On Tue, Jan 10, 2012 at 7:09 AM, Ashish Goel ashg...@gmail.com wrote: there is a matrix of 1 and 0 1 is a island and 0 is water 1-1 together

Re: [algogeeks] MS Q

2012-01-09 Thread Ashish Goel
row, col, diag all 1-1-1 is a single island :) 1 1 0 0 1 1 0 0 0 0 1 1 this has only 2 islands Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jan 10, 2012 at 7:29 AM, Ankur Garg ankurga...@gmail.com wrote: Can you give an example Say

Re: [algogeeks] MS Q

2012-01-09 Thread sravanreddy001
this is similar to the Pixel fill algorithm usually used in photo editing softwares (photoshop or paint ) BFS would be best approach to start with ( and check 4-adjacent or 8-includeing diagonal elements for a '1' and include that to queue. When the queue becomes empty, increase the count by

Re: [algogeeks] MS Q

2012-01-09 Thread atul anand
@sravanreddy001 : Pixel fill algorithm ..what is the exact name of that algo ??? -- 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] MS Q

2012-01-09 Thread atul anand
@Ashish Goel : didnt get it :( 1 1 0 0 1 1 0 0 0 0 1 1 1-1-1 diagonal is one island ...where is another?? 1 1 0 0 1 1 0 0 0 0 1 1 these 1 will be considered one island of 2 island.?? On Tue, Jan 10, 2012 at 7:36 AM, Ashish Goel ashg...@gmail.com wrote: row, col, diag all 1-1-1 is a

Re: [algogeeks] MS Q

2012-01-09 Thread sravanreddy001
@atul: given a matrix just like above, (usually an image) the pixel values with similar can be searched for around the current pixel, and they all can be marked in one go, think of an algorithm, which does the following 1) when a one is replaced by '2' manually, then algorithm changes every

Re: [algogeeks] MS Q

2012-01-09 Thread atul anand
@sravanreddy001 : got it ..thanks :) On Tue, Jan 10, 2012 at 9:33 AM, sravanreddy001 sravanreddy...@gmail.comwrote: @atul: given a matrix just like above, (usually an image) the pixel values with similar can be searched for around the current pixel, and they all can be marked in one go,

Re: [algogeeks] MS Q

2012-01-09 Thread Ramakant Sharma
Scan the matrix row wise left to right for each arr[i][j] if(arr[i][j]==1) { if (!(arr[i-1][j]==1||arr[i][j-1]==1)) count++; } ///also chk for baundary values accordingly 1 1 0 0 1 1 0 0 0 0 1 1 i think it should work.. -- You received this message because you are subscribed to the

Re: [algogeeks] MS Q

2012-01-09 Thread atul anand
@Ramakant : i guess you shud include diagonal case also for each arr[i][j] if(arr[i][j]==1) { if (!(arr[i-1][j]==1 || arr[i][j-1]==1 || arr[i-1][j-1])) count++; } On Tue, Jan 10, 2012 at 9:33 AM, Ramakant Sharma ramakant...@gmail.comwrote: Scan the matrix row wise left to right

Re: [algogeeks] MS Q

2012-01-09 Thread Ramakant Sharma
@atul: no..my approach was wrongwe have to check recursively...as sravan said -- 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] MS Q

2012-01-09 Thread Ashish Goel
this is a single island, sorry for that Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jan 10, 2012 at 9:24 AM, atul anand atul.87fri...@gmail.com wrote: @Ashish Goel : didnt get it :( 1 1 0 0 1 1 0 0 0 0 1 1 1-1-1 diagonal is one

Re: [algogeeks] MS Q

2012-01-09 Thread Ashish Goel
http://www.janaganamana.net/onedefault.aspx?bid=276 did not get it Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jan 10, 2012 at 1:15 PM, Ashish Goel ashg...@gmail.com wrote: this is a single island, sorry for that Best Regards

Re: [algogeeks] MS Q

2011-06-11 Thread Ashim Kapoor
I think RGGB is invalid as we have 4 different colors. On Fri, Jun 10, 2011 at 10:10 AM, Harshal hc4...@gmail.com wrote: #includeiostream #includestring using namespace std; void mastermind(char* guess, char* sol, int *hits, int *pseudohits) { int temp[256] = {0}; int

[algogeeks] MS Q

2011-06-09 Thread Piyush Sinha
Game of master mind: you have four balls, and four different colors, as a solution. The user tries to guess the solution. If they guess the right color for the right spot, it counts as a 'hit'. If it's the right color, but the wrong spot, it counts as a psuedo-hit. For example: if the solution is

Re: [algogeeks] MS Q

2011-06-09 Thread Harshal
#includeiostream #includestring using namespace std; void mastermind(char* guess, char* sol, int *hits, int *pseudohits) { int temp[256] = {0}; int len1=strlen(sol); int len2=strlen(guess); while(--len1+1) (guess[len1]==sol[len1]) ? ((*hits)+=1,temp[len1] = 1) : (temp[sol[len1]] +=

[algogeeks] MS Q

2011-06-02 Thread Ashish Goel
Given a function to draw a circle with input paramters as co-ordinates of centre of the circle and r is the radius of the circle. How will you test this function, what will be additional non-functional test cases Best Regards Ashish Goel Think positive and find fuel in failure +919985813081

Re: [algogeeks] MS Q

2011-06-02 Thread Sachin Jain
Can you please tell What are we testing here ?. I mean to ask what is the output of the function.. On Thu, Jun 2, 2011 at 7:49 PM, Ashish Goel ashg...@gmail.com wrote: Given a function to draw a circle with input paramters as co-ordinates of centre of the circle and r is the radius of the

Re: [algogeeks] MS Q

2011-06-02 Thread Harshal
some test cases: 1) r is -ive 2) r is 0 3) test center in all four quadrants. 4) r is some very large number On Thu, Jun 2, 2011 at 11:47 PM, Sachin Jain sachinjain...@gmail.comwrote: Can you please tell What are we testing here ?. I mean to ask what is the output of the function.. On