There are certain things that one need to test while assessing a driverless
car :-
1> *Gear* - Gears should be changed according to different speed lower
limits. For example -
1 st gear upto speed 10 km/hr.
2nd gear upto speed 30 km/hr
3rd ge
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
traffic,schoo
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 suitab
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, se
// 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; i
@ 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 wrote:
> i liked the solution given by the reference i have p
@ Ramakant : yupwont work.
On Tue, Jan 10, 2012 at 7:28 PM, Ramakant Sharma wrote:
>
> @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
@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
"Al
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 wou
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 mo
@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 Group
@Ramakant : for which test case your code would fail??
On Tue, Jan 10, 2012 at 1:04 PM, Ramakant Sharma wrote:
> @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
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 wrote:
> this is a single island, sorry for that
>
> Best Regards
> Ashish Goel
> "Th
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 wrote:
> @Ashish Goel : didnt get it :(
>
>
> 1 1 0 0
> 1 1 0 0
> 0 0 1 1
>
>
> 1-1-1 diagonal is one island ...wher
@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
@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 wrote:
> Scan the matrix row wise left to right
> for each arr[i][j]
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 Go
@sravanreddy001 : got it ..thanks :)
On Tue, Jan 10, 2012 at 9:33 AM, sravanreddy001 wrote:
> @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,
@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 '1'
@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 wrote:
> row, col, diag all
>
> 1-1-1 is a single island :)
>
@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 t
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 1.
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 wrote:
> Can you give an example
>
> Say matrix is
>
>
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 wrote:
> there is a matrix of 1 and 0
> 1 is a island and 0 is water
> 1-1 together makes one island
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
#include
int *calc(char *sol,char *guess)
{
int chk[4]={0,0,0.0};
int i,j;
for(i=0;i<4;i++)
{
if(sol[i]==guess[i])
{
chk[i]=2;
}
}
for(i=0;i<4;i++)
{
if(chk[i]!=2)
{
for(j=0;j<4;j++)
{
I think RGGB is invalid as we have 4 different colors.
On Fri, Jun 10, 2011 at 10:10 AM, Harshal wrote:
>
> #include
> #include
>
> using namespace std;
>
> void mastermind(char* guess, char* sol, int *hits, int *pseudohits)
> {
> int temp[256] = {0};
> int len1=strlen(sol);
> int len2=st
#include
#include
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]]
+= 1);
while(--le
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
'
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 wrote:
> 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
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 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 circle.
> How wi
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
+
32 matches
Mail list logo