Re: [algogeeks] Re: MS question

2011-09-26 Thread Yogesh Yadav
Suppose matrix is

1 0 0 1
1 0 1 0
0 0 0 0

then we traverse the matrix for each 1 we found at a[i][j] , we will check
for i=i to i wrote:

> If you're given that it's a sparse matrix, then you must assume
> storage is in a sparse matrix data structure to get time less than
> O(mn).
>
> In fact, if you assume the right data structure, then the operation
> can take O(1) time.
>
> For example if you say the structure is an array of sets of indices of
> the 1's in each row (so that L(i) is a list that contains j if and
> only if A(i,j) is a 1), then all you have to do is flip a bit saying
> the representation has changed, i.e. lookups will work differently.
> The old lookup is
>
> A(i,j) = if L(i) contains j then 1 else 0.
>
> The new lookup will be
>
> A(i,j) = if L(i) is nonempty or L(j) contains i then 1 else 0
>
> You'd probably want to store the sets in hash tables so that lookups
> will remain O(1). Other choices might make more sense if A has special
> structure.
>
> On Sep 26, 6:41 pm, Ankur Garg  wrote:
> > Guys an Update ,
> >
> > This has been asked in MS by me.. I suggested O(m*n) but they were
> looking
> > for a solution in nlogn ( n*n Sparse Matrix ) ..Any idea ...
> >
> > This post was discussed earlier but every1 came with O(m*n) solution so
> > instead of cluttering it ..opened a new One ...
> >
> >
> >
> > On Tue, Sep 27, 2011 at 3:06 AM, Gene  wrote:
> > > I assume we don't want to use extra storage.
> >
> > > So one way is this: Go over the matrix and mark the first row with a 1
> > > and the first column with a 1 for each 1 you find.  Because row and
> > > column 1 are used for temporary storage in this manner, you must first
> > > remember whether they contained a 1, then go ahead. With row and
> > > column 1 holding the necessary marks, you can fill in all the rows and
> > > columns except them. Finally you can fill in row and column 1 by
> > > checking the saved values.  It will look something like this.
> >
> > > row0has1 = 0;
> > > for (j = 0; j < n; j++) if (M(0,j)) { row0has1 = 1; break; }
> > > col0has1 = 0;
> > > for (i = 0; i < n; i++) if (M(i,0)) { col0has1 = 1; break; }
> > > for (i = 1; i < m; i++)
> > >  for (j = 1; j < n; j++)
> > >if (M(i,j)) M(i,0) = M(0,j) = 1;
> > > for (i = 1; i < m; i++)
> > >  for (j = 1; j < n; j++)
> > >if (M(i,0) || M(0,j)) M(i, j) = 1;
> > > if (row0has1)
> > >  for (j = 0; j < n; j++) M(0,j) = 1;
> > > if (col0has1)
> > >  for (i = 0; i < n; i++) M(i,0) = 1;
> >
> > > Maybe there's a slicker way, but this is O(mn)
> >
> > > On Sep 26, 9:46 pm, Ankur Garg  wrote:
> > > > Saw this question in one of the algo communities.
> >
> > > > Amazon telephonic interview question on Matrix
> > > > Input is a matrix of size n x m of 0's and 1's. eg:
> > > > 1 0 0 1
> > > > 0 0 1 0
> > > > 0 0 0 0
> >
> > > > If a location has 1; make all the elements of that row and column =
> 1. eg
> > > > 1 1 1 1
> > > > 1 1 1 1
> > > > 1 0 1 1
> >
> > > > Solution should be with Time complexity = O(n*m) and space complexity
> =
> > > O(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 more options, visit this group at
> > >http://groups.google.com/group/algogeeks?hl=en.
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Experience

2011-09-26 Thread Ankur Goel
nice thanks a lot

On Tue, Sep 27, 2011 at 11:47 AM, rShetty  wrote:

> Experiences, Technical and HR Questions and more of RVCE Information
> Science students in Campus Placements 2011.
>
>
> https://docs.google.com/document/d/1k5O1ijA-4M5pwxcvMhOYMFtWnJVoV5PM7aoF987SLhU/edit?hl=en_US
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Experience

2011-09-26 Thread shady
Thanks and dont give the permissions to modify it...

On Tue, Sep 27, 2011 at 11:47 AM, rShetty  wrote:

> Experiences, Technical and HR Questions and more of RVCE Information
> Science students in Campus Placements 2011.
>
>
> https://docs.google.com/document/d/1k5O1ijA-4M5pwxcvMhOYMFtWnJVoV5PM7aoF987SLhU/edit?hl=en_US
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Find the missing number - Again given 4 billion integers

2011-09-26 Thread Ashish Goel
the xor will not work if there are duplicates (not sure if that means 2
times 3 times etc) the statement is incomplete in the question

Best Regards
Ashish Goel
"Think positive and find fuel in failure"
+919985813081
+919966006652


On Mon, Jul 18, 2011 at 6:28 PM, Dumanshu  wrote:

> Hi
>
> sry for not being so clear with the problem statement.
>
> The list of numbers may have repetitions. Lots of numbers can be
> missing from the list, you just need to output any one.
>
> Regards
> Dumanshu
> BITS-Pilani
>
> On Jul 18, 5:28 pm, ankit sambyal  wrote:
> > The question says :" find the integer that is not there in the list."
> > So it seems that there is only one missing integer. Also the list
> > contains 2^32 integers and if we take all possible integers, assuming
> > an integer takes 4 bytes, we get 2^32 integers. So, if 1 integer is
> > missing in the list, it means that at least 1 no. is repeating in the
> > list. So, the xor method fails in this case.
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: MS question

2011-09-26 Thread Gene
If you're given that it's a sparse matrix, then you must assume
storage is in a sparse matrix data structure to get time less than
O(mn).

In fact, if you assume the right data structure, then the operation
can take O(1) time.

For example if you say the structure is an array of sets of indices of
the 1's in each row (so that L(i) is a list that contains j if and
only if A(i,j) is a 1), then all you have to do is flip a bit saying
the representation has changed, i.e. lookups will work differently.
The old lookup is

A(i,j) = if L(i) contains j then 1 else 0.

The new lookup will be

A(i,j) = if L(i) is nonempty or L(j) contains i then 1 else 0

You'd probably want to store the sets in hash tables so that lookups
will remain O(1). Other choices might make more sense if A has special
structure.

On Sep 26, 6:41 pm, Ankur Garg  wrote:
> Guys an Update ,
>
> This has been asked in MS by me.. I suggested O(m*n) but they were looking
> for a solution in nlogn ( n*n Sparse Matrix ) ..Any idea ...
>
> This post was discussed earlier but every1 came with O(m*n) solution so
> instead of cluttering it ..opened a new One ...
>
>
>
> On Tue, Sep 27, 2011 at 3:06 AM, Gene  wrote:
> > I assume we don't want to use extra storage.
>
> > So one way is this: Go over the matrix and mark the first row with a 1
> > and the first column with a 1 for each 1 you find.  Because row and
> > column 1 are used for temporary storage in this manner, you must first
> > remember whether they contained a 1, then go ahead. With row and
> > column 1 holding the necessary marks, you can fill in all the rows and
> > columns except them. Finally you can fill in row and column 1 by
> > checking the saved values.  It will look something like this.
>
> > row0has1 = 0;
> > for (j = 0; j < n; j++) if (M(0,j)) { row0has1 = 1; break; }
> > col0has1 = 0;
> > for (i = 0; i < n; i++) if (M(i,0)) { col0has1 = 1; break; }
> > for (i = 1; i < m; i++)
> >  for (j = 1; j < n; j++)
> >    if (M(i,j)) M(i,0) = M(0,j) = 1;
> > for (i = 1; i < m; i++)
> >  for (j = 1; j < n; j++)
> >    if (M(i,0) || M(0,j)) M(i, j) = 1;
> > if (row0has1)
> >  for (j = 0; j < n; j++) M(0,j) = 1;
> > if (col0has1)
> >  for (i = 0; i < n; i++) M(i,0) = 1;
>
> > Maybe there's a slicker way, but this is O(mn)
>
> > On Sep 26, 9:46 pm, Ankur Garg  wrote:
> > > Saw this question in one of the algo communities.
>
> > > Amazon telephonic interview question on Matrix
> > > Input is a matrix of size n x m of 0's and 1's. eg:
> > > 1 0 0 1
> > > 0 0 1 0
> > > 0 0 0 0
>
> > > If a location has 1; make all the elements of that row and column = 1. eg
> > > 1 1 1 1
> > > 1 1 1 1
> > > 1 0 1 1
>
> > > Solution should be with Time complexity = O(n*m) and space complexity =
> > O(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 more options, visit this group at
> >http://groups.google.com/group/algogeeks?hl=en.

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: google os ques on pipelining

2011-09-26 Thread Aditya Virmani
585 + (160 + 5)for slowest transactions *999 for the rest of the
instructions!

On Tue, Sep 27, 2011 at 12:49 AM, Gene  wrote:

> You guys have the right idea except that since it's multiple choice
> you can do this with no math.  With 1000 data items and only 4 stages,
> the bottleneck has to be the slowest pipeline stage with its register
> delay.  So you can answer b in 10 seconds and move on to the next
> question!
>
> On Sep 26, 8:50 pm, Dumanshu  wrote:
> > @bharat:
> > for the second part where u multiplied (160+5) with 999, it should be
> > 160*999 because it is max of (150,120,160,140,5). Correct me if i am
> > wrong.
> >
> > On Sep 26, 4:02 pm, bharatkumar bagana 
> > wrote:
> >
> >
> >
> > > for the first instruction : 150+5+120+5+160+5+140=585 ns
> > > for the rest of the instructions , though pipeline
> > > max(150,120,160,140)=160
> >
> > > (160+5)*999=164835 ns
> > >  we assume that there will be no extra stalls existed in our system
> > > -585 + 164835 =165420 ns =165.4 us...
> > > correct me if I'm wrong .
> >
> > > On Sun, Sep 25, 2011 at 9:25 AM, siva viknesh  >wrote:
> >
> > > > A 4-stage pipeline has the stage delays as 150, 120, 160 and 140 ns
> > > > (nano seconds)
> > > > respectively. Registers that are used between the stages have a delay
> > > > of 5 ns each. Assuming
> > > > constant clocking rate, the total time taken to process 1000 data
> > > > items on this pipeline will
> > > > approximately be
> > > > a. 120 us (micro seconds)
> > > > b. 165 us
> > > > c. 180 us
> > > > d. 175 us
> >
> > > > ...plz give detailed explanation for the ans
> >
> > > > --
> > > > 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 more options, visit this group at
> > > >http://groups.google.com/group/algogeeks?hl=en.
> >
> > > --
> >
> > > **Regards
> > > *BharatKumar Bagana*
> > > **http://www.google.com/profiles/bagana.bharatkumar<
> http://www.google.com/profiles/bagana.bharatkumar>
> > > *
> > > Mobile +91 8056127652*
> > > - Hide quoted text -
> >
> > - Show quoted text -
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Experience

2011-09-26 Thread rShetty
Experiences, Technical and HR Questions and more of RVCE Information
Science students in Campus Placements 2011.

https://docs.google.com/document/d/1k5O1ijA-4M5pwxcvMhOYMFtWnJVoV5PM7aoF987SLhU/edit?hl=en_US

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] output expalnation?

2011-09-26 Thread Ratan
On ideone.com its showing compiler error and on ubuntu garbage value
of b gets as the result...

On Tue, Sep 27, 2011 at 10:21 AM, gaurav yadav
 wrote:
> b=6 will not execute..
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Ratan Kumar
B. Tech
MNNIT,
Allahabad

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] output expalnation?

2011-09-26 Thread gaurav yadav
b=6 will not execute..

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread hurtlocker
if any one have this book plz send it to me also...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...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] output expalnation?

2011-09-26 Thread sukran dhawan
compile time error... except case labels nothing else will be executed in
case of switch statements... so definition of b will not be executed.so
compilation error

On Tue, Sep 27, 2011 at 6:28 AM, Ratan  wrote:

> #include
> int main()
> {
>int a=1;
>switch(a)
>{
> int b=6;
>case 1:
> printf("b is %d",b);
>break;
>default:
>printf("b is %d:",b);
>break;
>}
> return 0;
> }
>
> can any1 explain the o/p of this program...
>
>
>
>
>
> Thanxs n Regards
> --
> Ratan Modi
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: How to solve this algorithm graph problem in polynomial time?

2011-09-26 Thread yamini gupta
i think steiner tree can be used

On Sep 26, 10:05 pm, drealecs  wrote:
> I have a software problem and I'm searching for a solution but tried
> different algorithm approach and nothing came out.
> I'm not very familiar with all the graph algorithms and I hope there
> is already a way to solve this kind of problems in polynomial time.
>
> I need the algorithm for different task but I illustrated simple like
> this:
>
> The are N cities and there is a wanderer.
> The time it takes for him to go from a town to another town is known -
> Txy (from town x to town y).
> From any town he can go to another town so it is a complete graph.
> In each town there is a an amount of money Mx the wanderer wants to
> collect.
> It isn't enough time to pass through all cities.
> Having the total available time T and the starting point i, the
> problem is to find the best route so that the money he collects will
> be maximum.
>
> Input numbers range:
> N is between 400 and 600
> Mx(M1, M2, ...) are between 50 and 500, x between 1 and N
> Txy are between 1 and 200, x and y are between 1 and N, x!=y
> T is between 1000 and 5000
>
> The problems is shared 
> here:http://www.evernote.com/shard/s119/sh/79f47a65-c1e6-44da-bbc0-7d10e36...
>
> Thanks

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: output expalnation?

2011-09-26 Thread Sanjay Rajpal
Compilation error.
Definition of b is skipped by Switch statement.

so 'b' not declared/defined error will occur.

Correct me if m wrong.
Sanju
:)



On Mon, Sep 26, 2011 at 6:38 PM, deepikaanand wrote:

> junk value cz b=6 will not get executed
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: output expalnation?

2011-09-26 Thread deepikaanand
junk value cz b=6 will not get executed

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Amazon OS question

2011-09-26 Thread Kunal Patil
Nice question & nice answer... :)

On Tue, Sep 27, 2011 at 6:25 AM, UTKARSH SRIVASTAV
wrote:

> what's the algo of this question
>
>
> On Mon, Sep 26, 2011 at 2:38 PM, vikas wrote:
>
>> simple graph question,
>> graph is given as list , just check the dependancy
>>
>> On Sep 25, 6:25 pm, siva viknesh  wrote:
>> > thanks a lot yogesh...
>> >
>> > On Sep 25, 2:23 pm, Yogesh Yadav  wrote:
>> >
>> > > T1->T2->T3->T6
>> > > T1->T2->T4->T7
>> > > T1->T2->T5->T8
>> >
>> > > 2 Processor:
>> > > (T1->T2) ..2 TS
>> > > (T3&T4)...1 TS
>> > > (T6&T5)...1 TS
>> > > (T7&T8)...1 TS
>> >
>> > > 4 Processor
>> > > (T1->T2) ..2 TS
>> > > (T3&T4&T5)...1 TS
>> > > (T6&T7&T8)...1 TS
>> >
>> > > .
>> > > On Sun, Sep 25, 2011 at 2:33 PM, siva viknesh > >wrote:
>> >
>> > > > plz give detailed explanation
>> >
>> > > > On Sep 25, 1:58 pm, siva viknesh  wrote:
>> > > > > can u plz giv the sequence
>> >
>> > > > > On Sep 25, 11:36 am, Sanjay Rajpal  wrote:
>> >
>> > > > > > yah rite answer would be 5 and 4 resp.
>> > > > > > Sanju
>> > > > > > :)
>> >
>> > > > > > On Sat, Sep 24, 2011 at 10:04 PM, Dheeraj Sharma <
>> >
>> > > > > > dheerajsharma1...@gmail.com> wrote:
>> > > > > > > 5 & 4?
>> >
>> > > > > > > On Sun, Sep 25, 2011 at 9:33 AM, sivaviknesh s <
>> > > > sivavikne...@gmail.com>wrote:
>> >
>> > > > > > >> A parallel program consists of 8 tasks – T1 through T8. Each
>> task
>> > > > requires
>> > > > > > >> one time step to be executed on a single processor. Let X ->
>> Y
>> > > > denote the
>> > > > > > >> fact that task X must be executed before task Y is executed.
>> Suppose
>> > > > only
>> > > > > > >> the tasks X, Y are to be executed. On any multiprocessor
>> machine it
>> > > > would
>> > > > > > >> require at least 2 time steps since in the first step X could
>> be
>> > > > executed,
>> > > > > > >> and Y could be executed in the next time step (since it
>> requires X
>> > > > to
>> > > > > > >> complete first). Now, suppose the following dependencies
>> exist
>> > > > between the
>> > > > > > >> tasks T1 – T8:
>> >
>> > > > > > >> T1 -> T2
>> >
>> > > > > > >> T2 -> T3
>> >
>> > > > > > >> T3 -> T6
>> >
>> > > > > > >> T2 -> T4
>> >
>> > > > > > >> T4 -> T7
>> >
>> > > > > > >> T2 -> T5
>> >
>> > > > > > >> T5 -> T8
>> >
>> > > > > > >> What is the minimum number of time steps required to execute
>> these 8
>> > > > tasks
>> > > > > > >> on a 2 processor machine and a 4 processor machine?
>> >
>> > > > > > >> a)4 & 2
>> >
>> > > > > > >> b)5 & 2
>> >
>> > > > > > >> c)5 & 4
>> >
>> > > > > > >> d)6 & 2
>> >
>> > > > > > >> --
>> > > > > > >> Regards,
>> > > > > > >> $iva
>> >
>> > > > > > >> --
>> > > > > > >> 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 more options, visit this group at
>> > > > > > >>http://groups.google.com/group/algogeeks?hl=en.
>> >
>> > > > > > > --
>> > > > > > > *Dheeraj Sharma*
>> > > > > > > Comp Engg.
>> > > > > > > NIT Kurukshetra
>> >
>> > > > > > > --
>> > > > > > > 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 more options, visit this group at
>> > > > > > >http://groups.google.com/group/algogeeks?hl=en.
>> >
>> > > > --
>> > > > 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 more options, visit this group at
>> > > >http://groups.google.com/group/algogeeks?hl=en.
>>
>> --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> *UTKARSH SRIVASTAV
> CSE-3
> B-Tech 3rd Year
> @MNNIT ALLAHABAD*
>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscr

[algogeeks] output expalnation?

2011-09-26 Thread Ratan
#include
int main()
{
int a=1;
switch(a)
{
 int b=6;
case 1:
printf("b is %d",b);
break;
default:
printf("b is %d:",b);
break;
}
return 0;
}

can any1 explain the o/p of this program...





Thanxs n Regards
-- 
Ratan Modi

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Amazon OS question

2011-09-26 Thread UTKARSH SRIVASTAV
what's the algo of this question

On Mon, Sep 26, 2011 at 2:38 PM, vikas  wrote:

> simple graph question,
> graph is given as list , just check the dependancy
>
> On Sep 25, 6:25 pm, siva viknesh  wrote:
> > thanks a lot yogesh...
> >
> > On Sep 25, 2:23 pm, Yogesh Yadav  wrote:
> >
> > > T1->T2->T3->T6
> > > T1->T2->T4->T7
> > > T1->T2->T5->T8
> >
> > > 2 Processor:
> > > (T1->T2) ..2 TS
> > > (T3&T4)...1 TS
> > > (T6&T5)...1 TS
> > > (T7&T8)...1 TS
> >
> > > 4 Processor
> > > (T1->T2) ..2 TS
> > > (T3&T4&T5)...1 TS
> > > (T6&T7&T8)...1 TS
> >
> > > .
> > > On Sun, Sep 25, 2011 at 2:33 PM, siva viknesh  >wrote:
> >
> > > > plz give detailed explanation
> >
> > > > On Sep 25, 1:58 pm, siva viknesh  wrote:
> > > > > can u plz giv the sequence
> >
> > > > > On Sep 25, 11:36 am, Sanjay Rajpal  wrote:
> >
> > > > > > yah rite answer would be 5 and 4 resp.
> > > > > > Sanju
> > > > > > :)
> >
> > > > > > On Sat, Sep 24, 2011 at 10:04 PM, Dheeraj Sharma <
> >
> > > > > > dheerajsharma1...@gmail.com> wrote:
> > > > > > > 5 & 4?
> >
> > > > > > > On Sun, Sep 25, 2011 at 9:33 AM, sivaviknesh s <
> > > > sivavikne...@gmail.com>wrote:
> >
> > > > > > >> A parallel program consists of 8 tasks – T1 through T8. Each
> task
> > > > requires
> > > > > > >> one time step to be executed on a single processor. Let X -> Y
> > > > denote the
> > > > > > >> fact that task X must be executed before task Y is executed.
> Suppose
> > > > only
> > > > > > >> the tasks X, Y are to be executed. On any multiprocessor
> machine it
> > > > would
> > > > > > >> require at least 2 time steps since in the first step X could
> be
> > > > executed,
> > > > > > >> and Y could be executed in the next time step (since it
> requires X
> > > > to
> > > > > > >> complete first). Now, suppose the following dependencies exist
> > > > between the
> > > > > > >> tasks T1 – T8:
> >
> > > > > > >> T1 -> T2
> >
> > > > > > >> T2 -> T3
> >
> > > > > > >> T3 -> T6
> >
> > > > > > >> T2 -> T4
> >
> > > > > > >> T4 -> T7
> >
> > > > > > >> T2 -> T5
> >
> > > > > > >> T5 -> T8
> >
> > > > > > >> What is the minimum number of time steps required to execute
> these 8
> > > > tasks
> > > > > > >> on a 2 processor machine and a 4 processor machine?
> >
> > > > > > >> a)4 & 2
> >
> > > > > > >> b)5 & 2
> >
> > > > > > >> c)5 & 4
> >
> > > > > > >> d)6 & 2
> >
> > > > > > >> --
> > > > > > >> Regards,
> > > > > > >> $iva
> >
> > > > > > >> --
> > > > > > >> 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 more options, visit this group at
> > > > > > >>http://groups.google.com/group/algogeeks?hl=en.
> >
> > > > > > > --
> > > > > > > *Dheeraj Sharma*
> > > > > > > Comp Engg.
> > > > > > > NIT Kurukshetra
> >
> > > > > > > --
> > > > > > > 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 more options, visit this group at
> > > > > > >http://groups.google.com/group/algogeeks?hl=en.
> >
> > > > --
> > > > 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 more options, visit this group at
> > > >http://groups.google.com/group/algogeeks?hl=en.
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
*UTKARSH SRIVASTAV
CSE-3
B-Tech 3rd Year
@MNNIT ALLAHABAD*

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MS question

2011-09-26 Thread Ankur Garg
Guys an Update ,

This has been asked in MS by me.. I suggested O(m*n) but they were looking
for a solution in nlogn ( n*n Sparse Matrix ) ..Any idea ...

This post was discussed earlier but every1 came with O(m*n) solution so
instead of cluttering it ..opened a new One ...



On Tue, Sep 27, 2011 at 3:06 AM, Gene  wrote:

> I assume we don't want to use extra storage.
>
> So one way is this: Go over the matrix and mark the first row with a 1
> and the first column with a 1 for each 1 you find.  Because row and
> column 1 are used for temporary storage in this manner, you must first
> remember whether they contained a 1, then go ahead. With row and
> column 1 holding the necessary marks, you can fill in all the rows and
> columns except them. Finally you can fill in row and column 1 by
> checking the saved values.  It will look something like this.
>
> row0has1 = 0;
> for (j = 0; j < n; j++) if (M(0,j)) { row0has1 = 1; break; }
> col0has1 = 0;
> for (i = 0; i < n; i++) if (M(i,0)) { col0has1 = 1; break; }
> for (i = 1; i < m; i++)
>  for (j = 1; j < n; j++)
>if (M(i,j)) M(i,0) = M(0,j) = 1;
> for (i = 1; i < m; i++)
>  for (j = 1; j < n; j++)
>if (M(i,0) || M(0,j)) M(i, j) = 1;
> if (row0has1)
>  for (j = 0; j < n; j++) M(0,j) = 1;
> if (col0has1)
>  for (i = 0; i < n; i++) M(i,0) = 1;
>
> Maybe there's a slicker way, but this is O(mn)
>
> On Sep 26, 9:46 pm, Ankur Garg  wrote:
> > Saw this question in one of the algo communities.
> >
> > Amazon telephonic interview question on Matrix
> > Input is a matrix of size n x m of 0's and 1's. eg:
> > 1 0 0 1
> > 0 0 1 0
> > 0 0 0 0
> >
> > If a location has 1; make all the elements of that row and column = 1. eg
> > 1 1 1 1
> > 1 1 1 1
> > 1 0 1 1
> >
> > Solution should be with Time complexity = O(n*m) and space complexity =
> O(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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Amazon OS question

2011-09-26 Thread vikas
simple graph question,
graph is given as list , just check the dependancy

On Sep 25, 6:25 pm, siva viknesh  wrote:
> thanks a lot yogesh...
>
> On Sep 25, 2:23 pm, Yogesh Yadav  wrote:
>
> > T1->T2->T3->T6
> > T1->T2->T4->T7
> > T1->T2->T5->T8
>
> > 2 Processor:
> > (T1->T2) ..2 TS
> > (T3&T4)...1 TS
> > (T6&T5)...1 TS
> > (T7&T8)...1 TS
>
> > 4 Processor
> > (T1->T2) ..2 TS
> > (T3&T4&T5)...1 TS
> > (T6&T7&T8)...1 TS
>
> > .
> > On Sun, Sep 25, 2011 at 2:33 PM, siva viknesh wrote:
>
> > > plz give detailed explanation
>
> > > On Sep 25, 1:58 pm, siva viknesh  wrote:
> > > > can u plz giv the sequence
>
> > > > On Sep 25, 11:36 am, Sanjay Rajpal  wrote:
>
> > > > > yah rite answer would be 5 and 4 resp.
> > > > > Sanju
> > > > > :)
>
> > > > > On Sat, Sep 24, 2011 at 10:04 PM, Dheeraj Sharma <
>
> > > > > dheerajsharma1...@gmail.com> wrote:
> > > > > > 5 & 4?
>
> > > > > > On Sun, Sep 25, 2011 at 9:33 AM, sivaviknesh s <
> > > sivavikne...@gmail.com>wrote:
>
> > > > > >> A parallel program consists of 8 tasks – T1 through T8. Each task
> > > requires
> > > > > >> one time step to be executed on a single processor. Let X -> Y
> > > denote the
> > > > > >> fact that task X must be executed before task Y is executed. 
> > > > > >> Suppose
> > > only
> > > > > >> the tasks X, Y are to be executed. On any multiprocessor machine it
> > > would
> > > > > >> require at least 2 time steps since in the first step X could be
> > > executed,
> > > > > >> and Y could be executed in the next time step (since it requires X
> > > to
> > > > > >> complete first). Now, suppose the following dependencies exist
> > > between the
> > > > > >> tasks T1 – T8:
>
> > > > > >> T1 -> T2
>
> > > > > >> T2 -> T3
>
> > > > > >> T3 -> T6
>
> > > > > >> T2 -> T4
>
> > > > > >> T4 -> T7
>
> > > > > >> T2 -> T5
>
> > > > > >> T5 -> T8
>
> > > > > >> What is the minimum number of time steps required to execute these 
> > > > > >> 8
> > > tasks
> > > > > >> on a 2 processor machine and a 4 processor machine?
>
> > > > > >> a)4 & 2
>
> > > > > >> b)5 & 2
>
> > > > > >> c)5 & 4
>
> > > > > >> d)6 & 2
>
> > > > > >> --
> > > > > >> Regards,
> > > > > >> $iva
>
> > > > > >> --
> > > > > >> 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 more options, visit this group at
> > > > > >>http://groups.google.com/group/algogeeks?hl=en.
>
> > > > > > --
> > > > > > *Dheeraj Sharma*
> > > > > > Comp Engg.
> > > > > > NIT Kurukshetra
>
> > > > > > --
> > > > > > 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 more options, visit this group at
> > > > > >http://groups.google.com/group/algogeeks?hl=en.
>
> > > --
> > > 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 more options, visit this group at
> > >http://groups.google.com/group/algogeeks?hl=en.

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: MS question

2011-09-26 Thread Gene
I assume we don't want to use extra storage.

So one way is this: Go over the matrix and mark the first row with a 1
and the first column with a 1 for each 1 you find.  Because row and
column 1 are used for temporary storage in this manner, you must first
remember whether they contained a 1, then go ahead. With row and
column 1 holding the necessary marks, you can fill in all the rows and
columns except them. Finally you can fill in row and column 1 by
checking the saved values.  It will look something like this.

row0has1 = 0;
for (j = 0; j < n; j++) if (M(0,j)) { row0has1 = 1; break; }
col0has1 = 0;
for (i = 0; i < n; i++) if (M(i,0)) { col0has1 = 1; break; }
for (i = 1; i < m; i++)
  for (j = 1; j < n; j++)
if (M(i,j)) M(i,0) = M(0,j) = 1;
for (i = 1; i < m; i++)
  for (j = 1; j < n; j++)
if (M(i,0) || M(0,j)) M(i, j) = 1;
if (row0has1)
  for (j = 0; j < n; j++) M(0,j) = 1;
if (col0has1)
  for (i = 0; i < n; i++) M(i,0) = 1;

Maybe there's a slicker way, but this is O(mn)

On Sep 26, 9:46 pm, Ankur Garg  wrote:
> Saw this question in one of the algo communities.
>
> Amazon telephonic interview question on Matrix
> Input is a matrix of size n x m of 0's and 1's. eg:
> 1 0 0 1
> 0 0 1 0
> 0 0 0 0
>
> If a location has 1; make all the elements of that row and column = 1. eg
> 1 1 1 1
> 1 1 1 1
> 1 0 1 1
>
> Solution should be with Time complexity = O(n*m) and space complexity = O(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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: microsoft interview

2011-09-26 Thread Ankur Garg
@Teja Bala

U dont need the last line for a[0][0]

else code will be wrong

conside

0 0 0 0 1
0 0 0 0 0
0 1 0 0 0
0 0 0 1 0

Regards


On Sun, Sep 11, 2011 at 11:56 PM, teja bala wrote:

> //pseudo code dis  will work for sure.
>
> for(i=0;i for(j=0;j {
> if (a[i][j] == 1)
> {
> a[i][0] = 1;
> a[0][j] = 1;
> }
> }
> for(i=1;i for(j=1;j {
>  if (a[0][j] == 1 || a[i][0] == 1)
>  {
>   a[i][j] = 1;
>  }
> ]
> if (a[0][0] == 1)
> {
> for (i=0;i {
>  a[i][0] = 1;
> }
> for (i=0;i {
>  a[0][i] = 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] without using '-'

2011-09-26 Thread Kunal Yadav
@sandeep: Its simple xor. How can this be equal to difference??

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] without using '-'

2011-09-26 Thread sandeep kumar
difference = x^y

On Tue, Sep 27, 2011 at 1:42 AM, Kunal Yadav  wrote:

> @abhishek: absolutely correct abhishek :)
>
>
> On Mon, Sep 26, 2011 at 11:53 PM, aditya kumar <
> aditya.kumar130...@gmail.com> wrote:
>
>> +1 to abhishek
>>
>>
>> On Mon, Sep 26, 2011 at 11:44 PM, Abhishek Gupta <
>> guptaabhishe...@gmail.com> wrote:
>>
>>> thats basically taking twos' compliment and converting it to negative one
>>> and then adding it..its the same principle...which is used for dividing two
>>> numbers without using '/' and '-'...right kunal??
>>>
>>>
>>> On Mon, Sep 26, 2011 at 10:38 PM, Ashima . wrote:
>>>
 grt.we never generally use ~ operator. got to knw abt it.
 Ashima
 M.Sc.(Tech)Information Systems
  4th year
 BITS Pilani
 Rajasthan




 On Mon, Sep 26, 2011 at 10:07 AM, ~*~VICKY~*~ 
 wrote:

> Tricky question with more tricky answers. thank you all.
>
>
> On Mon, Sep 26, 2011 at 9:55 PM, Kunal Yadav 
> wrote:
>
>> difference = x+ ~y +1
>>
>> On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ > > wrote:
>>
>>> Find the difference of two numbers without using '-' operator !
>>>
>>> plz share ur solutions!
>>>
>>> --
>>> Cheers,
>>>
>>>   Vicky
>>>
>>>  --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Regards
>> Kunal Yadav
>> (http://sourcebit.in)
>>
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Cheers,
>
>   Vicky
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

  --
 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 more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.

>>>
>>>
>>>
>>> --
>>> Thanks & Regards
>>> Abhishek Gupta
>>>
>>>
>>>  --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards
> Kunal Yadav
> (http://sourcebit.in)
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
*..*
*
**Regards

Sandeep Kumar
MTech Computer Science
**IIT Madras*



Music washes away from the soul the dust of everyday life
-

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] without using '-'

2011-09-26 Thread Kunal Yadav
@abhishek: absolutely correct abhishek :)

On Mon, Sep 26, 2011 at 11:53 PM, aditya kumar  wrote:

> +1 to abhishek
>
>
> On Mon, Sep 26, 2011 at 11:44 PM, Abhishek Gupta <
> guptaabhishe...@gmail.com> wrote:
>
>> thats basically taking twos' compliment and converting it to negative one
>> and then adding it..its the same principle...which is used for dividing two
>> numbers without using '/' and '-'...right kunal??
>>
>>
>> On Mon, Sep 26, 2011 at 10:38 PM, Ashima .  wrote:
>>
>>> grt.we never generally use ~ operator. got to knw abt it.
>>> Ashima
>>> M.Sc.(Tech)Information Systems
>>>  4th year
>>> BITS Pilani
>>> Rajasthan
>>>
>>>
>>>
>>>
>>> On Mon, Sep 26, 2011 at 10:07 AM, ~*~VICKY~*~ 
>>> wrote:
>>>
 Tricky question with more tricky answers. thank you all.


 On Mon, Sep 26, 2011 at 9:55 PM, Kunal Yadav wrote:

> difference = x+ ~y +1
>
> On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ 
> wrote:
>
>> Find the difference of two numbers without using '-' operator !
>>
>> plz share ur solutions!
>>
>> --
>> Cheers,
>>
>>   Vicky
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards
> Kunal Yadav
> (http://sourcebit.in)
>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



 --
 Cheers,

   Vicky

  --
 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 more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.

>>>
>>>  --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Thanks & Regards
>> Abhishek Gupta
>>
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Regards
Kunal Yadav
(http://sourcebit.in)

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] MS question

2011-09-26 Thread Ankur Garg
Saw this question in one of the algo communities.

Amazon telephonic interview question on Matrix
Input is a matrix of size n x m of 0's and 1's. eg:
1 0 0 1
0 0 1 0
0 0 0 0

If a location has 1; make all the elements of that row and column = 1. eg
1 1 1 1
1 1 1 1
1 0 1 1

Solution should be with Time complexity = O(n*m) and space complexity = O(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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: google os ques on pipelining

2011-09-26 Thread Gene
You guys have the right idea except that since it's multiple choice
you can do this with no math.  With 1000 data items and only 4 stages,
the bottleneck has to be the slowest pipeline stage with its register
delay.  So you can answer b in 10 seconds and move on to the next
question!

On Sep 26, 8:50 pm, Dumanshu  wrote:
> @bharat:
> for the second part where u multiplied (160+5) with 999, it should be
> 160*999 because it is max of (150,120,160,140,5). Correct me if i am
> wrong.
>
> On Sep 26, 4:02 pm, bharatkumar bagana 
> wrote:
>
>
>
> > for the first instruction : 150+5+120+5+160+5+140=585 ns
> > for the rest of the instructions , though pipeline
> > max(150,120,160,140)=160
>
> > (160+5)*999=164835 ns
> >  we assume that there will be no extra stalls existed in our system
> > -585 + 164835 =165420 ns =165.4 us...
> > correct me if I'm wrong .
>
> > On Sun, Sep 25, 2011 at 9:25 AM, siva viknesh wrote:
>
> > > A 4-stage pipeline has the stage delays as 150, 120, 160 and 140 ns
> > > (nano seconds)
> > > respectively. Registers that are used between the stages have a delay
> > > of 5 ns each. Assuming
> > > constant clocking rate, the total time taken to process 1000 data
> > > items on this pipeline will
> > > approximately be
> > > a. 120 us (micro seconds)
> > > b. 165 us
> > > c. 180 us
> > > d. 175 us
>
> > > ...plz give detailed explanation for the ans
>
> > > --
> > > 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 more options, visit this group at
> > >http://groups.google.com/group/algogeeks?hl=en.
>
> > --
>
> > **Regards
> > *BharatKumar Bagana*
> > **http://www.google.com/profiles/bagana.bharatkumar
> > *
> > Mobile +91 8056127652*
> > - Hide quoted text -
>
> - Show quoted text -

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: BST in file

2011-09-26 Thread Gene
Here is a little program to show how it works.  It's a nice little
problem.  There is also a coding with recursion.

#include 
#include 

typedef struct node_s {
  int data;
  struct node_s *left, *right;
} NODE;

void print_tree(NODE *tree)
{
  if (tree == NULL) return;
  print_tree(tree->left);
  printf(" %d", tree->data);
  print_tree(tree->right);
}

void save_tree(NODE *tree)
{
  if (tree == NULL) return;
  printf("%d\n", tree->data);
  save_tree(tree->left);
  save_tree(tree->right);
}

NODE *new_node(int data)
{
  NODE *node = malloc(sizeof *node);
  node->data = data;
  node->left = node->right = NULL;
  return node;
}

NODE *read_tree(void)
{
  int data, sp = 0;
  NODE *root, *node, *last, *stack[1];

  // Loop invariants: Root holds tree root.
  // Last holds last node added.
  // Stack[i] holds the unique node at
  // level i to which a right child might
  // still be added.
  root = last = NULL;
  while (scanf("%d", &data) == 1) {
node = new_node(data);
if (root == NULL)
  root = node;
else {
  // If new node has key < last, it must
  // be the left child of last. Attach and
  // push onto stack because we still
  // may receive a right child.
  if (data < last->data) {
last->left = node;
stack[sp++] = last;
  }
  // Else it has key > last, so if the key is also <
  // the deepest level waiting for a right child, it
  // can only be right child of the last node.
  else if (sp == 0 || data < stack[sp - 1]->data)
last->right = node;
  // Else it must be the right child of an ancestor.
  // The possible ancestors are on the stack.
  // Pop the stack until we find the last ancestor
  // with larger key and attach there.
  else {
while (sp > 1 && data > stack[sp - 2]->data)
  --sp;
stack[--sp]->right = node;
  }
}
last = node;
  }
  return root;
}

int main(void)
{
  print_tree(read_tree());
  return 0;
}


On Sep 24, 8:28 pm, vikas  wrote:
> if this is simple BST then only preorder will suffice
>
> On Sep 24, 10:16 pm, wetheart  wrote:
>
>
>
> > You can put the array representation of binary tree directly, with
> > some obvious modifications ofcourse :)
>
> > On Sep 24, 5:38 pm, asdqwe  wrote:
>
> > > you can put two traversals of three (inorder, preorder or postorder)
> > > in the file..
> > > Two traversals are enough to dedicate a particular tree.
>
> > > On Sep 24, 4:05 pm, Asit Dhal  wrote:
>
> > > > I need to print a binary search tree in file. When I will retrieve the 
> > > > same
> > > > tree from the file.
>
> > > > I have thought about printing in xml format like this
>
> > > >           100
> > > >          /     \
> > > >       50      150
> > > >      /   \       /   \
> > > >    30  70   120 200
>
> > > > 
> > > > 100
> > > > 
> > > > 50
> > > > 
> > > > 30
> > > > 
> > > > 
> > > > 70
> > > > 
> > > > 
> > > > 
> > > > 150
> > > > 
> > > > 120
> > > > 
> > > > 
> > > > 200
> > > > 
> > > > 
> > > > 
>
> > > > I don't know will this be the best solution or not.
>
> > > > Please suggest me how to approach it or some better solution.
>
> > > > Regards
> > > > Asithttp://kodeyard.blogspot.com/- Hide quoted text -
>
> - Show quoted text -

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: google os ques on pipelining

2011-09-26 Thread Dumanshu
@bharat:
for the second part where u multiplied (160+5) with 999, it should be
160*999 because it is max of (150,120,160,140,5). Correct me if i am
wrong.

On Sep 26, 4:02 pm, bharatkumar bagana 
wrote:
> for the first instruction : 150+5+120+5+160+5+140=585 ns
> for the rest of the instructions , though pipeline
> max(150,120,160,140)=160
>
> (160+5)*999=164835 ns
>  we assume that there will be no extra stalls existed in our system
> -585 + 164835 =165420 ns =165.4 us...
> correct me if I'm wrong .
>
> On Sun, Sep 25, 2011 at 9:25 AM, siva viknesh wrote:
>
>
>
>
>
>
>
>
>
> > A 4-stage pipeline has the stage delays as 150, 120, 160 and 140 ns
> > (nano seconds)
> > respectively. Registers that are used between the stages have a delay
> > of 5 ns each. Assuming
> > constant clocking rate, the total time taken to process 1000 data
> > items on this pipeline will
> > approximately be
> > a. 120 us (micro seconds)
> > b. 165 us
> > c. 180 us
> > d. 175 us
>
> > ...plz give detailed explanation for the ans
>
> > --
> > 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 more options, visit this group at
> >http://groups.google.com/group/algogeeks?hl=en.
>
> --
>
> **Regards
> *BharatKumar Bagana*
> **http://www.google.com/profiles/bagana.bharatkumar
> *
> Mobile +91 8056127652*
> 

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread sukran dhawan
ya pl send

On Mon, Sep 26, 2011 at 8:04 PM, rahul sharma wrote:

> itz same as at scribd.comnot complete..i think
> itz not easilty availabl
>
>
> 2011/9/26 Vιиodh 
>
>> @yogesh : pages are missing in the book u ve mailed man... ly few pages
>> are ther in the book u jus maile..
>>
>>
>> On Mon, Sep 26, 2011 at 7:23 PM, Yogesh Yadav  wrote:
>>
>>>
>>> 
>>>
>>> --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> With regards,
>> Vιиodh
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] without using '-'

2011-09-26 Thread aditya kumar
+1 to abhishek

On Mon, Sep 26, 2011 at 11:44 PM, Abhishek Gupta
wrote:

> thats basically taking twos' compliment and converting it to negative one
> and then adding it..its the same principle...which is used for dividing two
> numbers without using '/' and '-'...right kunal??
>
>
> On Mon, Sep 26, 2011 at 10:38 PM, Ashima .  wrote:
>
>> grt.we never generally use ~ operator. got to knw abt it.
>> Ashima
>> M.Sc.(Tech)Information Systems
>>  4th year
>> BITS Pilani
>> Rajasthan
>>
>>
>>
>>
>> On Mon, Sep 26, 2011 at 10:07 AM, ~*~VICKY~*~ wrote:
>>
>>> Tricky question with more tricky answers. thank you all.
>>>
>>>
>>> On Mon, Sep 26, 2011 at 9:55 PM, Kunal Yadav wrote:
>>>
 difference = x+ ~y +1

 On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ 
 wrote:

> Find the difference of two numbers without using '-' operator !
>
> plz share ur solutions!
>
> --
> Cheers,
>
>   Vicky
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



 --
 Regards
 Kunal Yadav
 (http://sourcebit.in)


  --
 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 more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.

>>>
>>>
>>>
>>> --
>>> Cheers,
>>>
>>>   Vicky
>>>
>>>  --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Thanks & Regards
> Abhishek Gupta
>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] without using '-'

2011-09-26 Thread Abhishek Gupta
thats basically taking twos' compliment and converting it to negative one
and then adding it..its the same principle...which is used for dividing two
numbers without using '/' and '-'...right kunal??

On Mon, Sep 26, 2011 at 10:38 PM, Ashima .  wrote:

> grt.we never generally use ~ operator. got to knw abt it.
> Ashima
> M.Sc.(Tech)Information Systems
>  4th year
> BITS Pilani
> Rajasthan
>
>
>
>
> On Mon, Sep 26, 2011 at 10:07 AM, ~*~VICKY~*~ wrote:
>
>> Tricky question with more tricky answers. thank you all.
>>
>>
>> On Mon, Sep 26, 2011 at 9:55 PM, Kunal Yadav wrote:
>>
>>> difference = x+ ~y +1
>>>
>>> On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ wrote:
>>>
 Find the difference of two numbers without using '-' operator !

 plz share ur solutions!

 --
 Cheers,

   Vicky

  --
 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 more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.

>>>
>>>
>>>
>>> --
>>> Regards
>>> Kunal Yadav
>>> (http://sourcebit.in)
>>>
>>>
>>>  --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Cheers,
>>
>>   Vicky
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Thanks & Regards
Abhishek Gupta

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] without using '-'

2011-09-26 Thread Ashima .
grt.we never generally use ~ operator. got to knw abt it.
Ashima
M.Sc.(Tech)Information Systems
4th year
BITS Pilani
Rajasthan




On Mon, Sep 26, 2011 at 10:07 AM, ~*~VICKY~*~ wrote:

> Tricky question with more tricky answers. thank you all.
>
>
> On Mon, Sep 26, 2011 at 9:55 PM, Kunal Yadav wrote:
>
>> difference = x+ ~y +1
>>
>> On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ wrote:
>>
>>> Find the difference of two numbers without using '-' operator !
>>>
>>> plz share ur solutions!
>>>
>>> --
>>> Cheers,
>>>
>>>   Vicky
>>>
>>>  --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>
>>
>> --
>> Regards
>> Kunal Yadav
>> (http://sourcebit.in)
>>
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Cheers,
>
>   Vicky
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] without using '-'

2011-09-26 Thread ~*~VICKY~*~
Tricky question with more tricky answers. thank you all.

On Mon, Sep 26, 2011 at 9:55 PM, Kunal Yadav  wrote:

> difference = x+ ~y +1
>
> On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ wrote:
>
>> Find the difference of two numbers without using '-' operator !
>>
>> plz share ur solutions!
>>
>> --
>> Cheers,
>>
>>   Vicky
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards
> Kunal Yadav
> (http://sourcebit.in)
>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Cheers,

  Vicky

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] How to solve this algorithm graph problem in polynomial time?

2011-09-26 Thread drealecs
I have a software problem and I'm searching for a solution but tried
different algorithm approach and nothing came out.
I'm not very familiar with all the graph algorithms and I hope there
is already a way to solve this kind of problems in polynomial time.

I need the algorithm for different task but I illustrated simple like
this:

The are N cities and there is a wanderer.
The time it takes for him to go from a town to another town is known -
Txy (from town x to town y).
>From any town he can go to another town so it is a complete graph.
In each town there is a an amount of money Mx the wanderer wants to
collect.
It isn't enough time to pass through all cities.
Having the total available time T and the starting point i, the
problem is to find the best route so that the money he collects will
be maximum.

Input numbers range:
N is between 400 and 600
Mx(M1, M2, ...) are between 50 and 500, x between 1 and N
Txy are between 1 and 200, x and y are between 1 and N, x!=y
T is between 1000 and 5000


The problems is shared here:
http://www.evernote.com/shard/s119/sh/79f47a65-c1e6-44da-bbc0-7d10e36c7f71/374eda2f355c9a18d41ea19a20866fbc

Thanks

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] google os ques on pipelining

2011-09-26 Thread gaurav yadav
bharatkumar bagan...can u plz explain why u multipiled (160+5) with 999 ?

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] without using '-'

2011-09-26 Thread Kunal Yadav
difference = x+ ~y +1

On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ wrote:

> Find the difference of two numbers without using '-' operator !
>
> plz share ur solutions!
>
> --
> Cheers,
>
>   Vicky
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Regards
Kunal Yadav
(http://sourcebit.in)

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] without using '-'

2011-09-26 Thread aditya kumar
find the smallest of two number . then keep adding 1 to the smaller number
till you get the bigger number .
this will give you absolute diff so check for the correct ans .
in case you have floating number then add unit of fraction . and repeat the
same .
On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~ wrote:

> Find the difference of two numbers without using '-' operator !
>
> plz share ur solutions!
>
> --
> Cheers,
>
>   Vicky
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] without using '-'

2011-09-26 Thread ~*~VICKY~*~
Find the difference of two numbers without using '-' operator !

plz share ur solutions!

-- 
Cheers,

  Vicky

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Does anyone know how to see solutions submitted on spoj.pl by any user which is accepted

2011-09-26 Thread Deoki Nandan
ok thanks

On 26 September 2011 16:11, shady  wrote:

> you can't... if you are having trouble solving some problem, you can always
> discuss it in spoj forums. spoj.pl/forum
>
> On Mon, Sep 26, 2011 at 3:54 PM, Deoki Nandan  wrote:
>
>> Thanks in advance
>>
>> --
>> **With Regards
>> Deoki Nandan Vishwakarma
>>
>> *
>> *
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
**With Regards
Deoki Nandan Vishwakarma

*
*

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread rahul sharma
itz same as at scribd.comnot complete..i think
itz not easilty availabl

2011/9/26 Vιиodh 

> @yogesh : pages are missing in the book u ve mailed man... ly few pages are
> ther in the book u jus maile..
>
>
> On Mon, Sep 26, 2011 at 7:23 PM, Yogesh Yadav  wrote:
>
>>
>> 
>>
>> --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> With regards,
> Vιиodh
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread Vιиodh
@yogesh : pages are missing in the book u ve mailed man... ly few pages are
ther in the book u jus maile..

On Mon, Sep 26, 2011 at 7:23 PM, Yogesh Yadav  wrote:

>
> 
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
With regards,
Vιиodh

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread shady
i would have appreciated it if you had understood my mail :p
if someone is having the book he will mail it to the group and not
selectively to so many people :)

On Mon, Sep 26, 2011 at 5:58 PM, abhishek  wrote:

> @ shady i appreciate you
> but can't resist myself as i barely need it
> so plz mail me as well
>
> On Sep 26, 4:25 pm, shady  wrote:
> > if someone is having the book, he/she will not specifically mail it to
> each
> > and everyone of you... rather to the mailing list.. so stop sending these
> > mails
> > if (you have the book)
> >  then mail
> > else
> >  do nothing
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Sep 26, 2011 at 4:35 PM, sahil sharma 
> wrote:
> > >  pls send me d book too
> >
> > >>   really need it
> >
> > > thanks
> > > regards
> > >  sahil
> >
> > > --
> > > 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 more options, visit this group at
> > >http://groups.google.com/group/algogeeks?hl=en.
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread rahul sharma
plz upload this on this group.. or mail  to everyone i also need
it...mail me if nyone has

On Mon, Sep 26, 2011 at 5:58 PM, abhishek  wrote:

> @ shady i appreciate you
> but can't resist myself as i barely need it
> so plz mail me as well
>
> On Sep 26, 4:25 pm, shady  wrote:
> > if someone is having the book, he/she will not specifically mail it to
> each
> > and everyone of you... rather to the mailing list.. so stop sending these
> > mails
> > if (you have the book)
> >  then mail
> > else
> >  do nothing
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Sep 26, 2011 at 4:35 PM, sahil sharma 
> wrote:
> > >  pls send me d book too
> >
> > >>   really need it
> >
> > > thanks
> > > regards
> > >  sahil
> >
> > > --
> > > 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 more options, visit this group at
> > >http://groups.google.com/group/algogeeks?hl=en.
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Amazon Interview Question

2011-09-26 Thread Naren s
dutch national flag problem..search in wiki...classical.

On Sat, Sep 24, 2011 at 9:39 AM, VIHARRI  wrote:

> You are given a string (consisting of 0's, 1's or 2's) where 0
> represents a blue ball, 1 a
> red ball, and 2 a black ball. Using only swap operations (counting
> sort not allowed)
> rearrange the string such that all blue balls are together on one
> side, followed by all red
> balls, and then all black balls. You can iterate through the string
> only once.
> Eg 102112011 should produce 00122
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
*Narayanan S,*
B.E., C.S.E., (final year),
College Of Engineering Guindy,
Anna University,
Chennai-25.

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Yahoo! visit

2011-09-26 Thread abhishek
here is the process of paypal/ebay india

written test ---40 ques in 60 min (no negative marking)
 interview 1
interview 2
HR interview


written was a mix of technical and aptitude question

interview 1
first asked me about my hobby and discussed about 5 to 10 min on it
discussed on project
asked me to draw some diagrams related to project
and asked to implement the class patient (as my project was hospital
management system)
then question on traversing the link list

interview 2
asked 3 puzzle on time and distance
friend class concept
reversing a string without using any temporary variable
a question on link list from the written test

and there was no HR interview for me
BTW this was just formality
they were checking comm skill and willingness to join
On Sep 23, 7:17 pm, vartika aggarwal 
wrote:
> If anyone has any idea about the process of Ebay and/or Yahoo! (especially
> the questions asked), kindly post it here soon...it's visiting our campus on
> Sunday..
> Please help!
>
> --
> Regards
>
> Vartika Aggarwal
> Undergraduate Student
> IT Department
> NSIT, Dwarka

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] NAGARRO CODING ROUND

2011-09-26 Thread partik madan
Have anyone appeared for *NAGARRO* recently? can ne one mention there rounds
experience; like wat type of coding problems they ask in their coding
rounds.. please share your experiences !!

-- 
*Partik Madan*
Computer Engg.
NIT Kurukshetra

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Yahoo

2011-09-26 Thread abhishek
c,c++ ,java

On Sep 26, 4:15 pm, Akash Mukherjee  wrote:
> any language pref?? are bash solns acceptable??
>
>
>
>
>
>
>
> On Mon, Sep 26, 2011 at 12:04 PM, abhishek  wrote:
>
> > a file is given containing lots of records seprated by new line
> > (records can be repeat)
> > and a substring given for eg"abc"
>
> > now check for the record which contains the substring
> > and print top 10 record according to their frequency
>
> > derive algo with complexity o(n)
>
> > On Sep 26, 10:58 am, htross  wrote:
> > > can u explain more on the coding  question u solved?
>
> > > On Sep 26, 9:08 am, aditya kumar  wrote:
>
> > > > I cleared the written round, the next round was coding round.
>
> > > > We were asked to select any one problem out of three in 2 hrs.
>
> > > > Q1) Given n number of xml files find a particular word and output
> > should
> > > > list all the files in current directory that contains that word.
>
> > > > Q2) Given a hierarichal structure i.e., you have a parent class, a
> > child
> > > > class which extends a parent class which has some attributes and
> > methods.
> > > > You need
>
> > > > to parse the structure and output should give you the set of the base
> > class,
> > > > set of derived class, set of attribute set and the set of method.
>
> > > > Q3) Input -> India is a great country. Key(alphanumeric) - B2. You have
> > to
> > > > encrypt the given sentence, in such a way that only the words should be
> > > > jumbled.
>
> > > > Output -> great India a is country. While decrypting it, you have to
> > use the
> > > > same alpha numeric key and we should be able to get the same original
> > > > string,
>
> > > > i.e., India is a great country.
>
> > > > I opted for the 3rd question, I used an array to store the starting
> > offset
> > > > of a word and i used key to shuffle the offset. i used hash function
> > which
> > > > takes
>
> > > > the key and according the key value it shuffles the set of offsets
> > while
> > > > doing encryption. While decrypting i used the reverse method and i
> > shuffled
> > > > the same
>
> > > > way to get back the original offset. After 2 hrs the external asked me
> > to
> > > > explain my logic, i explained each and every line and he was very much
> > happy
> > > > with
>
> > > > the algorithm. He asked all the students to wait outside.
>
> > > > They shortly announced the results for the next interview round.
>
> > > > Technical round -1
>
> > > > He asked me whether i was nervous, i told him frankly, yes sir a little
> > bit.
> > > > Then he motivated me by saying that you have done well in the previous
> > > > rounds
>
> > > > thats why you are here.
>
> > > > Then he asked me to solve a problem. The problem was given a time in
> > format
> > > > of hh:mm we have to find the min angle between hr nd min hand.
>
> > > > I answered him well and he was happy with that so he did not aske me to
> > > > write the code.
>
> > > > Second question -> There is a system which continuously takes stream of
> > data
> > > > from one end, and from other end we want to retrive the particualr
> > number
> > > > is
>
> > > > present in the system or not. Example -> If you are retriving for 10
> > and if
> > > > it is present then return the same number else return the closest value
> > to
> > > > that
>
> > > > number. I used hashing then he asked me if I had a large input let us
> > say in
> > > > lakhs then hashing is not ideal approach. Then i told him that its
> > better to
> > > > use
>
> > > > max heap. Then he said ok and before moving to next questions he told
> > me
> > > > that there are other better approach to this.
>
> > > > He asked about my favourite subjects since i told my fav subject was
> > OS, he
> > > > started askimg me questions about OS.
>
> > > > The questions were
>
> > > > -Difference b/w semaphore and monitor
>
> > > > -There are two threads, one produces even number and other produces odd
> > > > number, how will you print the consecutive numbers.
>
> > > > -What is semaphore and how will you implement it?
>
> > > > -What is deadlock and what are 4 conditions of deadlock.
>
> > > > -Simulate deadlock(Pictorial diagram).
>
> > > > -Which data structure will you use for deadlock?
>
> > > > I answered all the above questions so he was very much happy with it.
>
> > > > Then and there he told me that i wont eliminate you in this round and
> > would
> > > > like to see you in next round.
>
> > > > Technical round-2
>
> > > > He asked me about my previous round experience and asked me to
> > introduce
> > > > myself for another 2/3 mins.
>
> > > > He gave me a problem, there is a function which returns 0 or 1. You
> > need to
> > > > pass each and every element of the array one by one to that function
> > and
>
> > > > depending on the return value, you need to store all the numbers in
> > such a
> > > > way that all the true values should appear first and all the false
> > value
> > > > should
>
> > > > appear last. After thinking for some tim

[algogeeks] Re: request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread abhishek
@ shady i appreciate you
but can't resist myself as i barely need it
so plz mail me as well

On Sep 26, 4:25 pm, shady  wrote:
> if someone is having the book, he/she will not specifically mail it to each
> and everyone of you... rather to the mailing list.. so stop sending these
> mails
> if (you have the book)
>  then mail
> else
>  do nothing
>
>
>
>
>
>
>
> On Mon, Sep 26, 2011 at 4:35 PM, sahil sharma  wrote:
> >  pls send me d book too
>
> >>       really need it
>
> > thanks
> > regards
> >  sahil
>
> > --
> > 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 more options, visit this group at
> >http://groups.google.com/group/algogeeks?hl=en.

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Amazon Interview Question

2011-09-26 Thread sukran dhawan
count the number of 0s 1s 2s.then store os first den 1s followed by 2s

On Sat, Sep 24, 2011 at 9:55 AM, Anup Ghatage  wrote:

> Is this like the segregating all the 1's to the right and the 0's to the
> left
> or am i missing something?
>
>
> On Sat, Sep 24, 2011 at 9:39 AM, VIHARRI  wrote:
>
>> You are given a string (consisting of 0's, 1's or 2's) where 0
>> represents a blue ball, 1 a
>> red ball, and 2 a black ball. Using only swap operations (counting
>> sort not allowed)
>> rearrange the string such that all blue balls are together on one
>> side, followed by all red
>> balls, and then all black balls. You can iterate through the string
>> only once.
>> Eg 102112011 should produce 00122?
>>
>>
>> --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Anup Ghatage
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread shady
if someone is having the book, he/she will not specifically mail it to each
and everyone of you... rather to the mailing list.. so stop sending these
mails
if (you have the book)
 then mail
else
 do nothing


On Mon, Sep 26, 2011 at 4:35 PM, sahil sharma  wrote:

>  pls send me d book too
>>>
>>   really need it
>
>
>
> thanks
> regards
>  sahil
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Yahoo

2011-09-26 Thread Akash Mukherjee
any language pref?? are bash solns acceptable??

On Mon, Sep 26, 2011 at 12:04 PM, abhishek  wrote:

>
> a file is given containing lots of records seprated by new line
> (records can be repeat)
> and a substring given for eg"abc"
>
> now check for the record which contains the substring
> and print top 10 record according to their frequency
>
> derive algo with complexity o(n)
>
> On Sep 26, 10:58 am, htross  wrote:
> > can u explain more on the coding  question u solved?
> >
> > On Sep 26, 9:08 am, aditya kumar  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > I cleared the written round, the next round was coding round.
> >
> > > We were asked to select any one problem out of three in 2 hrs.
> >
> > > Q1) Given n number of xml files find a particular word and output
> should
> > > list all the files in current directory that contains that word.
> >
> > > Q2) Given a hierarichal structure i.e., you have a parent class, a
> child
> > > class which extends a parent class which has some attributes and
> methods.
> > > You need
> >
> > > to parse the structure and output should give you the set of the base
> class,
> > > set of derived class, set of attribute set and the set of method.
> >
> > > Q3) Input -> India is a great country. Key(alphanumeric) - B2. You have
> to
> > > encrypt the given sentence, in such a way that only the words should be
> > > jumbled.
> >
> > > Output -> great India a is country. While decrypting it, you have to
> use the
> > > same alpha numeric key and we should be able to get the same original
> > > string,
> >
> > > i.e., India is a great country.
> >
> > > I opted for the 3rd question, I used an array to store the starting
> offset
> > > of a word and i used key to shuffle the offset. i used hash function
> which
> > > takes
> >
> > > the key and according the key value it shuffles the set of offsets
> while
> > > doing encryption. While decrypting i used the reverse method and i
> shuffled
> > > the same
> >
> > > way to get back the original offset. After 2 hrs the external asked me
> to
> > > explain my logic, i explained each and every line and he was very much
> happy
> > > with
> >
> > > the algorithm. He asked all the students to wait outside.
> >
> > > They shortly announced the results for the next interview round.
> >
> > > Technical round -1
> >
> > > He asked me whether i was nervous, i told him frankly, yes sir a little
> bit.
> > > Then he motivated me by saying that you have done well in the previous
> > > rounds
> >
> > > thats why you are here.
> >
> > > Then he asked me to solve a problem. The problem was given a time in
> format
> > > of hh:mm we have to find the min angle between hr nd min hand.
> >
> > > I answered him well and he was happy with that so he did not aske me to
> > > write the code.
> >
> > > Second question -> There is a system which continuously takes stream of
> data
> > > from one end, and from other end we want to retrive the particualr
> number
> > > is
> >
> > > present in the system or not. Example -> If you are retriving for 10
> and if
> > > it is present then return the same number else return the closest value
> to
> > > that
> >
> > > number. I used hashing then he asked me if I had a large input let us
> say in
> > > lakhs then hashing is not ideal approach. Then i told him that its
> better to
> > > use
> >
> > > max heap. Then he said ok and before moving to next questions he told
> me
> > > that there are other better approach to this.
> >
> > > He asked about my favourite subjects since i told my fav subject was
> OS, he
> > > started askimg me questions about OS.
> >
> > > The questions were
> >
> > > -Difference b/w semaphore and monitor
> >
> > > -There are two threads, one produces even number and other produces odd
> > > number, how will you print the consecutive numbers.
> >
> > > -What is semaphore and how will you implement it?
> >
> > > -What is deadlock and what are 4 conditions of deadlock.
> >
> > > -Simulate deadlock(Pictorial diagram).
> >
> > > -Which data structure will you use for deadlock?
> >
> > > I answered all the above questions so he was very much happy with it.
> >
> > > Then and there he told me that i wont eliminate you in this round and
> would
> > > like to see you in next round.
> >
> > > Technical round-2
> >
> > > He asked me about my previous round experience and asked me to
> introduce
> > > myself for another 2/3 mins.
> >
> > > He gave me a problem, there is a function which returns 0 or 1. You
> need to
> > > pass each and every element of the array one by one to that function
> and
> >
> > > depending on the return value, you need to store all the numbers in
> such a
> > > way that all the true values should appear first and all the false
> value
> > > should
> >
> > > appear last. After thinking for some time i came up with O(n) solution,
> he
> > > asked me to future optimze it. Within 2 mins he moved on to next
> question.
> >
> > > Next question was a puzzle about aliens.
> >
> > > Thir

Re: [algogeeks] request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread sahil sharma
>
> pls send me d book too
>>
>   really need it



thanks
regards
 sahil

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] google os ques on pipelining

2011-09-26 Thread bharatkumar bagana
for the first instruction : 150+5+120+5+160+5+140=585 ns
for the rest of the instructions , though pipeline
max(150,120,160,140)=160

(160+5)*999=164835 ns
 we assume that there will be no extra stalls existed in our system
-585 + 164835 =165420 ns =165.4 us...
correct me if I'm wrong .

On Sun, Sep 25, 2011 at 9:25 AM, siva viknesh wrote:

> A 4-stage pipeline has the stage delays as 150, 120, 160 and 140 ns
> (nano seconds)
> respectively. Registers that are used between the stages have a delay
> of 5 ns each. Assuming
> constant clocking rate, the total time taken to process 1000 data
> items on this pipeline will
> approximately be
> a. 120 us (micro seconds)
> b. 165 us
> c. 180 us
> d. 175 us
>
> ...plz give detailed explanation for the ans
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 

**Regards
*BharatKumar Bagana*
**http://www.google.com/profiles/bagana.bharatkumar
*
Mobile +91 8056127652*


-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread payal gupta
had been finnding d buk since many daz..
plzzz..do send d buk 2 me 2...
thnx...in advance...:)

regards,
PAYAL GUPTA,
CSE-3rd YR
NIT_B

On Mon, Sep 26, 2011 at 4:03 PM, sangeeta goyal wrote:

> i also need that book
>
>
> On Mon, Sep 26, 2011 at 6:00 AM, Amit Mittal wrote:
>
>> plz send me that book too
>>
>>
>> On Mon, Sep 26, 2011 at 3:28 PM, Ishan Aggarwal <
>> ishan.aggarwal.1...@gmail.com> wrote:
>>
>>> plz send me that book to
>>> I also need that book...
>>>
>>>
>>> On Sun, Sep 25, 2011 at 9:37 PM, sarath prasath >> > wrote:
>>>
 hi every one..
 pls do give me the link if u find or have, about this book..
 title name:"Data Structures and Algorithms Made Easy: 700 Data
 Structure and Algorithmic Puzzles"
 author:"Narasimha Karumanchi"
 ISBN-10: 145654988X
 ISBN-13: 978-1456549886
 publisher:careermonk..
 pls do send to this email id..."prasathsar...@gmail.com"

 --
 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 more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


>>>
>>>
>>> --
>>> Kind Regards
>>> Ishan Aggarwal
>>> [image: Aricent Group]
>>> Presidency Tower-A, M.G.Road,Sector-14
>>> Gurgaon,Haryana.122015 INDIA
>>> Phone : +91-9654602663
>>> ishan2.aggar...@aricent.com 
>>>
>>>  --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Hello World

2011-09-26 Thread avinesh saini
Explain this code-
It is supposed to print-  "Hello World"


#include 
using namespace std;
int main()
{
long long int
l1l[]={72,-11037827,917043223,-47519989,1450408591,-194718605,2037206149,-8912843,279667,-26713,-3617,1571,-79};

longlongintll1[]={1,9240,277200,13440,725760,290304,14515200,483840,193536,483840,14515200,15966720,31933440};
long double lll=1;
long long int l1='\0'+1, ll='\0'+1;
for (int i='\0'; i<'\r'; i=i+1)
{
for (int j='\r'-1; j>='\0'; j=j-1)
{
for (int k='\0'; khttp://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Does anyone know how to see solutions submitted on spoj.pl by any user which is accepted

2011-09-26 Thread shady
you can't... if you are having trouble solving some problem, you can always
discuss it in spoj forums. spoj.pl/forum

On Mon, Sep 26, 2011 at 3:54 PM, Deoki Nandan  wrote:

> Thanks in advance
>
> --
> **With Regards
> Deoki Nandan Vishwakarma
>
> *
> *
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread sangeeta goyal
i also need that book


On Mon, Sep 26, 2011 at 6:00 AM, Amit Mittal  wrote:

> plz send me that book too
>
>
> On Mon, Sep 26, 2011 at 3:28 PM, Ishan Aggarwal <
> ishan.aggarwal.1...@gmail.com> wrote:
>
>> plz send me that book to
>> I also need that book...
>>
>>
>> On Sun, Sep 25, 2011 at 9:37 PM, sarath prasath 
>> wrote:
>>
>>> hi every one..
>>> pls do give me the link if u find or have, about this book..
>>> title name:"Data Structures and Algorithms Made Easy: 700 Data
>>> Structure and Algorithmic Puzzles"
>>> author:"Narasimha Karumanchi"
>>> ISBN-10: 145654988X
>>> ISBN-13: 978-1456549886
>>> publisher:careermonk..
>>> pls do send to this email id..."prasathsar...@gmail.com"
>>>
>>> --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>
>>
>> --
>> Kind Regards
>> Ishan Aggarwal
>> [image: Aricent Group]
>> Presidency Tower-A, M.G.Road,Sector-14
>> Gurgaon,Haryana.122015 INDIA
>> Phone : +91-9654602663
>> ishan2.aggar...@aricent.com 
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Does anyone know how to see solutions submitted on spoj.pl by any user which is accepted

2011-09-26 Thread Deoki Nandan
Thanks in advance

-- 
**With Regards
Deoki Nandan Vishwakarma

*
*

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread Amit Mittal
plz send me that book too

On Mon, Sep 26, 2011 at 3:28 PM, Ishan Aggarwal <
ishan.aggarwal.1...@gmail.com> wrote:

> plz send me that book to
> I also need that book...
>
>
> On Sun, Sep 25, 2011 at 9:37 PM, sarath prasath 
> wrote:
>
>> hi every one..
>> pls do give me the link if u find or have, about this book..
>> title name:"Data Structures and Algorithms Made Easy: 700 Data
>> Structure and Algorithmic Puzzles"
>> author:"Narasimha Karumanchi"
>> ISBN-10: 145654988X
>> ISBN-13: 978-1456549886
>> publisher:careermonk..
>> pls do send to this email id..."prasathsar...@gmail.com"
>>
>> --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>
>
> --
> Kind Regards
> Ishan Aggarwal
> [image: Aricent Group]
> Presidency Tower-A, M.G.Road,Sector-14
> Gurgaon,Haryana.122015 INDIA
> Phone : +91-9654602663
> ishan2.aggar...@aricent.com 
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread Ishan Aggarwal
plz send me that book to
I also need that book...


On Sun, Sep 25, 2011 at 9:37 PM, sarath prasath wrote:

> hi every one..
> pls do give me the link if u find or have, about this book..
> title name:"Data Structures and Algorithms Made Easy: 700 Data
> Structure and Algorithmic Puzzles"
> author:"Narasimha Karumanchi"
> ISBN-10: 145654988X
> ISBN-13: 978-1456549886
> publisher:careermonk..
> pls do send to this email id..."prasathsar...@gmail.com"
>
> --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Kind Regards
Ishan Aggarwal
[image: Aricent Group]
Presidency Tower-A, M.G.Road,Sector-14
Gurgaon,Haryana.122015 INDIA
Phone : +91-9654602663
ishan2.aggar...@aricent.com 

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] request of ebook..(Data Structures and algorithms made easy:)

2011-09-26 Thread Deoki Nandan
plz mail me this ebook the given link does not have complete pages only 94
pages can be viewed

On 26 September 2011 05:27, Bhanu Kishore  wrote:

>
> http://www.scribd.com/doc/50658450/Data-Structures-and-Algorithms-Made-Easy-For-Interviews-Programming-Interview-Questions
>
>
> On Sun, Sep 25, 2011 at 9:37 PM, sarath prasath 
> wrote:
>
>> hi every one..
>> pls do give me the link if u find or have, about this book..
>> title name:"Data Structures and Algorithms Made Easy: 700 Data
>> Structure and Algorithmic Puzzles"
>> author:"Narasimha Karumanchi"
>> ISBN-10: 145654988X
>> ISBN-13: 978-1456549886
>> publisher:careermonk..
>> pls do send to this email id..."prasathsar...@gmail.com"
>>
>> --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
**With Regards
Deoki Nandan Vishwakarma

*
*

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Amazon Question

2011-09-26 Thread Deoki Nandan
can you tell how to write code to access log file

On 26 September 2011 09:27, teja bala  wrote:

> do dfs traversal along the two log files and maintain a stack in which push
> the element from 1st log file and if matching id in 2 log file is found pop
> it and display it to user
> but dis 'll take extra stack space ,,,
>
> another sol.. maintain a bit array for any of the log file and while doing
> BFS traversal if any nth  common id found set the nth bit in bit array and
> thus retrieving the data where the bit is set
>
>
> On Mon, Sep 26, 2011 at 1:32 AM, khushboo lohia wrote:
>
>> Are the customer id's in 2 files in sorted order ?
>>
>>
>> On Mon, Sep 26, 2011 at 1:29 AM, Ankur Garg  wrote:
>>
>>> You are given 2 log files each having 1 billion entries and each entry
>>> has a unique customer id.You need to print the records in two files which
>>> are common.
>>>
>>>
>>>
>>>  --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
**With Regards
Deoki Nandan Vishwakarma

*
*

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Sourcebits [wrriten n interview round]

2011-09-26 Thread aditya kumar
5.5 lakhs

On Mon, Sep 26, 2011 at 1:46 PM, Aditya Virmani wrote:

> what package did they offer?
>
> On Mon, Sep 26, 2011 at 9:41 AM, aditya kumar <
> aditya.kumar130...@gmail.com> wrote:
>
>> 1st round was a written test . It had 30 mcq's . This was the easiest
>> mcq's .
>> 20 simple aptitude questions were thr along with some 10 C questions .
>>
>> 21 students were shortlisted for the first round .
>> in the interview round they asked me basics questions possibly from all
>> the subjects .
>> 1) deadlock and their condition .
>> 2) any three unix command .
>> 3) dangling pointer and how to avoid dangling ptr .
>> 4) osi layers , their function and protocols used in applocation layer
>> 5) virtual function . and why are they needed .
>> 6) process management .
>> 7) l-value .(this is the only question where i couldnt find proper example
>> to explain )
>> 8) lseek , what happens if do lseek after we have reached the end of a
>> file .
>> 9) syntax of open command in unix .
>> 10) features of oops and some real life example .
>> 11) how to do data hiding in oops .
>>
>> and few more question which i dint remember
>>
>> For 15 mins he asked me about my project . He went into details of few of
>> them .
>> Since i had done my projects on android so i guess it added to my
>> advantage .
>>
>> after the long four hour wait they announced shortlisted candidates for HR
>> round .
>> they short listed 13 out of 21.
>>
>> In HR round :
>> This was very different Hr round as it was on skype that too video call.
>> Here you got to be very careful coz you dont have the liberty to properly
>> express yourself with hand gestures . There were basic HR questions .
>> Basically you need to sell yourself acc to thier needs . So i convinced them
>> with proper evidence and examples that i am kind of candidates they are
>> looking for . Its very important to go thru the comoany websites since then
>> only you can try explaining  them how you can fit into company needs .
>>
>> It took them almost 36 hrs to announce the results .
>> Finally they short-listed 6 out of 13 .
>>
>>
>> On Mon, Sep 26, 2011 at 9:35 AM, manoj  wrote:
>>
>>> hi guys sourcebits is visiting  our campus tomorrow
>>> can anybody please telll us what type of question  wiill be there in
>>> wrriten and interview around
>>> it would be great help :)
>>>
>>> --
>>> 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 more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>  --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Sourcebits [wrriten n interview round]

2011-09-26 Thread Aditya Virmani
what package did they offer?

On Mon, Sep 26, 2011 at 9:41 AM, aditya kumar
wrote:

> 1st round was a written test . It had 30 mcq's . This was the easiest mcq's
> .
> 20 simple aptitude questions were thr along with some 10 C questions .
>
> 21 students were shortlisted for the first round .
> in the interview round they asked me basics questions possibly from all the
> subjects .
> 1) deadlock and their condition .
> 2) any three unix command .
> 3) dangling pointer and how to avoid dangling ptr .
> 4) osi layers , their function and protocols used in applocation layer
> 5) virtual function . and why are they needed .
> 6) process management .
> 7) l-value .(this is the only question where i couldnt find proper example
> to explain )
> 8) lseek , what happens if do lseek after we have reached the end of a file
> .
> 9) syntax of open command in unix .
> 10) features of oops and some real life example .
> 11) how to do data hiding in oops .
>
> and few more question which i dint remember
>
> For 15 mins he asked me about my project . He went into details of few of
> them .
> Since i had done my projects on android so i guess it added to my advantage
> .
>
> after the long four hour wait they announced shortlisted candidates for HR
> round .
> they short listed 13 out of 21.
>
> In HR round :
> This was very different Hr round as it was on skype that too video call.
> Here you got to be very careful coz you dont have the liberty to properly
> express yourself with hand gestures . There were basic HR questions .
> Basically you need to sell yourself acc to thier needs . So i convinced them
> with proper evidence and examples that i am kind of candidates they are
> looking for . Its very important to go thru the comoany websites since then
> only you can try explaining  them how you can fit into company needs .
>
> It took them almost 36 hrs to announce the results .
> Finally they short-listed 6 out of 13 .
>
>
> On Mon, Sep 26, 2011 at 9:35 AM, manoj  wrote:
>
>> hi guys sourcebits is visiting  our campus tomorrow
>> can anybody please telll us what type of question  wiill be there in
>> wrriten and interview around
>> it would be great help :)
>>
>> --
>> 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 more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>  --
> 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 more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
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 more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.