Hello any one have idea about Flipkart recruitment process for SDE1. Please
guide me what to prepare.
Thanks
--
regard's
Avinash
--
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.co
@Priya : if first row is the max one , then it is actually boundary case
which you can be handled easily,once you are done which above algo.
please note that only first row need to checked if it max not every row ,
above algo is handling this . you can also modify given algo which will
handle this
if u have seen the iostream file then it begins like this:-
#include
#include
#include
*
*
*namespace std *
{
/**
* @name Standard Stream Objects
*
* The header declares the eight standard stream
* objects. For other declarations, see
* http://gcc.gnu.org/online
using name space std
Please explain about this
thnx
--
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...@googleg
@sachin..thnx for explanation..got it..plz tell
#include
int main()
{
char str[]={'a','b','c'};
char str1[]={"abc"};
printf("%d",sizeof(str));
printf("%d",sizeof(str1));
getchar();
}
why str has size 3 and str1 has 4...NUll should also come after c of
str???then y 3??
You'd need: max(#vertices-with-0in-degree, #vertices-with-0out-degree)
edges at least.
On 8 October 2012 20:20, bharat b wrote:
> @jaspreet: take an ex:
> B->A
> B->C
> B->D
> Here the no.of zero-indegree is one . But its not the correct ans.
>
>
> On Mon, Oct 8, 2012 at 1:19 AM, Jaspreet Sing
ok the algo will go like this :
count no of nodes having only indegree 0 , only outdegree 0 and both 0. say
in_count,out_count and both_count are the corresponding counts.
now decrease the counts accordingly if u found a matching like u can
decrease in_count by both_count if both_count0 and in
degr
@empo I believe you missed the point where Dave is setting arr[0] as elem.
So this while condition will break at size = 0.
Thanks
Sachin
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To view this discussion on the web visit
https://group
yeah you are correct bharat .. so i think it should be no. of nodes having
0 (in-degree + out-degree). what say ?
On Mon, Oct 8, 2012 at 8:20 PM, bharat b wrote:
> @jaspreet: take an ex:
> B->A
> B->C
> B->D
> Here the no.of zero-indegree is one . But its not the correct ans.
>
>
> On Mon, Oct 8
@ Mengal.
That's what I thought actually
But, he had set the value of arr[0] = elem
So, it will stop at zeroth element and won't go to -1th element.
On Mon, Oct 8, 2012 at 12:01 AM, Mangal Dev Gupta wrote:
> *@Dave while( arr[--size] != elem );*
>
> *Exception will come when it will encounter a
@rahul According to C specification, half filled array will be filled with
value 0. In your example you are setting str[0] as 'g' and str[1] as 'k'.
So the compiler sets str[29] as 0. So you string str becomes
{'g', 'k', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'}
Confusion is arising fr
@atul if the largest matrix is [a1 b1 c1 d1 ] i mean if it is the
first row or if it is [c2 d2.i think then then ur code wont be giving the
right answer.
c3 d3]
correct me if i'm wrong
On Monday, January
@dharmendradoes every uninitialized memory has NULL or there can be
some garbage value also...plz comment???
On Mon, Oct 8, 2012 at 9:02 PM, rahul sharma wrote:
> If its NULL then y does it give segmentation fault as for NULL it should
> print an empty stringplz xomment
>
>
> On Sun,
If its NULL then y does it give segmentation fault as for NULL it should
print an empty stringplz xomment
On Sun, Oct 7, 2012 at 6:56 PM, DHARMENDRA KUMAR VERMA <
dharmendrakumarverm...@gmail.com> wrote:
> Bcoz u r trying to access an argument which doesnt even exist...
> for exmple
@jaspreet: take an ex:
B->A
B->C
B->D
Here the no.of zero-indegree is one . But its not the correct ans.
On Mon, Oct 8, 2012 at 1:19 AM, Jaspreet Singh wrote:
> count the no. of nodes having 0 in-degree.
>
>
> On Mon, Oct 8, 2012 at 12:44 AM, atul anand wrote:
>
>> yeah i read it wrongly ..
@ Mangal : well if see the soln carefully then before loop starts elem is
assigned to arr[0] and copy of arr[0] is saved to temp. This will make sure
that the elem exists in the arr[] ,so it will never reach arr[-1] . when
size become =0 then it will come out of the loop bcoz of the assignment
done
@Dave: Nice solution. Can you clarify why you need to store the first
element in a temp variable and put 'elem' in the first position? If elem
was already first in array then it makes no difference. If elem was not
first but somewhere in between, the loop will break there when coming from
behind an
count the no. of nodes having 0 in-degree.
On Mon, Oct 8, 2012 at 12:44 AM, atul anand wrote:
> yeah i read it wrongly .. i thought ques was asking to find total
> strongly connected component in the graph
>
> On 10/7/12, bharat b wrote:
> > @atul : if there is no cut vertex, that doesn't m
will it not give an erroneous result since, argc = number of elements in
argv starting from 0?
On Sun, Oct 7, 2012 at 6:33 PM, rahul sharma wrote:
> #include
> int main(int argc,char *argv[])
> {
>
> printf("%d\n",argv[argc]);
> getchar();
> return 0;
>
> }
>
>
> what will it print
*@Dave while( arr[--size] != elem );*
*Exception will come when it will encounter a[-1]*
*i dont know if this loop will ever end... very poor solution i will say
*
On Sat, Oct 6, 2012 at 10:00 PM, Umer Farooq wrote:
> Well actually, I've just gone through Dave's code thoroughly and I believe
>
@atul: No,it's not the correct answer. Let's take an example of star like
DAG:-
A-->
B-->C
|
V
D
This DAG contains only one cut vertex(B) but we need to add two edges to
make it strongly connected.
On Sat, Oc
Bcoz u r trying to access an argument which doesnt even exist...
for exmple ./a.out --> argc=1
(argv[0]="./a.out",argv[1]=NULL(not exist))
./a.out 1st_arg --> argc=2
(argv[0]="./a.out",argv[1]="1st_arg",argv[2]=NULL(not exist));
resulting '0' as %d specifier is used the
22 matches
Mail list logo