[algogeeks] Experience

2011-09-27 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] Re: google os ques on pipelining

2011-09-27 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 gene.ress...@gmail.com 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 duman...@gmail.com 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 bagana.bharatku...@gmail.com
  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 sivavikne...@gmail.com
 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*
   bagana.bharatku...@gmail.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.



-- 
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-27 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 ankurga...@gmail.com 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 gene.ress...@gmail.com 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 ankurga...@gmail.com 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: Find the missing number - Again given 4 billion integers

2011-09-27 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 duman...@gmail.com 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 ankitsamb...@gmail.com 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.



Re: [algogeeks] Experience

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

On Tue, Sep 27, 2011 at 11:47 AM, rShetty rajeevr...@gmail.com 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-27 Thread Ankur Goel
nice thanks a lot

On Tue, Sep 27, 2011 at 11:47 AM, rShetty rajeevr...@gmail.com 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: MS question

2011-09-27 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 irow and j=j to jcol if that contains any more 1

if it contains 1 in row then we don't make the whole row as 1..we ignore the
row  and same will be for column

if it don't contains any other 1 after that (i,j) location then we make the
whole row as 1.. and same will be for column




i know this is not in O(mn) but i just want to check if my logic is correct
or not...because it can be used somewhere else...

.

On Tue, Sep 27, 2011 at 11:51 AM, Gene gene.ress...@gmail.com 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 ankurga...@gmail.com 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 gene.ress...@gmail.com 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 ankurga...@gmail.com 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.



[algogeeks] Re: without using '-'

2011-09-27 Thread rajan

Given Two numbers A  B (lets say).Find the smaller number,
B(assuming). Divide the larger number by the smaller one.Get the value
stored in X (lets say). Then use % operator to get the value stored in
Y(lets say).

Now the answer-  ((X-1) * B) + Y

Now again '-' operator cannot be used

so, my solution- ((X+strcmp(a,b)) * B) + Y   [strcmp() will return
-1]

Regards,
Rajan Bhuyan
B.E(Hons) Computer Science
BITS Pilani

-- 
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-27 Thread Alexandru Patranescu
one more detail:
*Txy* is optimal distance so that *Txy  Txz + Tzy*, for any x, y and z 
between 1 and N.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/Aj5bWWD59swJ.
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: without using '-'

2011-09-27 Thread hary rathor
@ rajan
 -ve sign already used inside strcmp function

-- 
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-27 Thread Alexandru Patranescu
I meant *Txy  Txz + Tzy*

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/HgHVuO5qNj8J.
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: without using '-'

2011-09-27 Thread rajan


On Sep 27, 12:19 pm, hary rathor harry.rat...@gmail.com wrote:
 @ rajan
  -ve sign already used inside strcmp function

ya hary u are right.. i thnk i ll come up with one more way to
subtract -1

Regards,
Rajan Bhuyan
B.E(Hons) Computer Science
BITS Pilani

-- 
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] Segment Tree Optimization

2011-09-27 Thread Aamir Khan
I am trying to solve http://www.spoj.pl/problems/LITE/ using segment tree.
Here's the code but i am getting TLE. Can somebody help me to optimize the
code ?

#includecstdio
#includealgorithm

struct node{
   int l;
   int r;
   bool el ;
   node *left;
   node *right;
};

struct node *build(int l, int r) {
   struct node *root = new node;
   root-l = l;
   root-r = r;
   root-el = 0;
   if(l==r) {
  root-left=NULL;
  root-right=NULL;
  return root;
   }
   root-left = build(l,(l+r)/2);
   root-right= build((l+r)/2+1,r);
   return root;
}

int query(struct node *root, int l, int r) {
   if(root==NULL || rl)
   return 0;

   if((root-el)  (root-l)=l  (root-r)=r) {
  return (r - l + 1);
   }

   int mid = (root-l + root-r)/2;
   return query(root-left, l, std::min(mid,r)) + query(root-right,
std::max(mid+1,l), r);

}

void update(struct node *root, int l,int r) {
   if(root-l==l  root-r==r  (root-left==NULL || root-el)) {
  root-el = 1 - root-el;
  return;
   }

   if(root-el) {
  root-left-el = 1;
  root-right-el = 1;
  root-el = 0;
   }

   int mid = (root-l + root-r)/2;
   if(l = mid)
   update(root-left, l, std::min(mid,r));
   if(r  mid)
   update(root-right, std::max(mid+1,l), r);
}

int main() {
   int N, M;
   scanf(%d %d,N,M);
   struct node *root =   build(1,N);
   int L,R;
   int c;
   while(M--) {
  scanf(%d %d %d\n,c,L,R);
  if(c==0)
  update(root, L, R);
  else
  printf(%d\n,query(root,L,R));
   }
   return 0;
}





Aamir Khan | 3rd Year  | Computer Science  Engineering | IIT Roorkee

-- 
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] Segment Tree Optimization

2011-09-27 Thread sunny agrawal
implement segment tree with lazy propagation :)

On Tue, Sep 27, 2011 at 1:19 PM, Aamir Khan ak4u2...@gmail.com wrote:

 I am trying to solve http://www.spoj.pl/problems/LITE/ using segment tree.
 Here's the code but i am getting TLE. Can somebody help me to optimize the
 code ?

 #includecstdio
 #includealgorithm

 struct node{
int l;
int r;
bool el ;
node *left;
node *right;
 };

 struct node *build(int l, int r) {
struct node *root = new node;
root-l = l;
root-r = r;
root-el = 0;
if(l==r) {
   root-left=NULL;
   root-right=NULL;
   return root;
}
root-left = build(l,(l+r)/2);
root-right= build((l+r)/2+1,r);
return root;
 }

 int query(struct node *root, int l, int r) {
if(root==NULL || rl)
return 0;

if((root-el)  (root-l)=l  (root-r)=r) {
   return (r - l + 1);
}

int mid = (root-l + root-r)/2;
return query(root-left, l, std::min(mid,r)) + query(root-right,
 std::max(mid+1,l), r);

 }

 void update(struct node *root, int l,int r) {
if(root-l==l  root-r==r  (root-left==NULL || root-el)) {
   root-el = 1 - root-el;
   return;
}

if(root-el) {
   root-left-el = 1;
   root-right-el = 1;
   root-el = 0;
}

int mid = (root-l + root-r)/2;
if(l = mid)
update(root-left, l, std::min(mid,r));
if(r  mid)
update(root-right, std::max(mid+1,l), r);
 }

 int main() {
int N, M;
scanf(%d %d,N,M);
struct node *root =   build(1,N);
int L,R;
int c;
while(M--) {
   scanf(%d %d %d\n,c,L,R);
   if(c==0)
   update(root, L, R);
   else
   printf(%d\n,query(root,L,R));
}
return 0;
 }





 Aamir Khan | 3rd Year  | Computer Science  Engineering | IIT Roorkee


  --
 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.




-- 
Sunny Aggrawal
B.Tech. V year,CSI
Indian Institute Of Technology,Roorkee

-- 
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] Segment Tree Optimization

2011-09-27 Thread Tamanna Afroze
The code is already optimized...

-- 
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 - Median of a BST without using extra space and in O(n)

2011-09-27 Thread Ankur Garg
I was thinking of making the tree balanced with equal no of nodes in left
and right subtree

Median will be root in this case


Regards
Ankur

-- 
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] MS Question - Median of a BST without using extra space and in O(n)

2011-09-27 Thread anshu mishra
do the inorder traversal as soon as reached at n/2th element that will be
median.

-- 
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] MS Question - Median of a BST without using extra space and in O(n)

2011-09-27 Thread Ankur Garg
@Anshu

Will u be using extra space to store ur nodes in traversal  ?



On Tue, Sep 27, 2011 at 2:22 PM, anshu mishra anshumishra6...@gmail.comwrote:

 do the inorder traversal as soon as reached at n/2th element that will be
 median.

 --
 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] MS Question - Median of a BST without using extra space and in O(n)

2011-09-27 Thread Dheeraj Sharma
keep a  global pointer and a global variable check=0

do inorder traversal..instead of printing the value do

  if(check==0)
 save pointer
check==1
   else
  check==0;

correct me if m wrong

On Tue, Sep 27, 2011 at 2:22 PM, anshu mishra anshumishra6...@gmail.comwrote:

 do the inorder traversal as soon as reached at n/2th element that will be
 median.

 --
 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.



Re: [algogeeks] Segment Tree Optimization

2011-09-27 Thread Aamir Khan
On Tue, Sep 27, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote:

 implement segment tree with lazy propagation :)


What do you mean by lazy propagation ?

-- 
 Sunny Aggrawal
 B.Tech. V year,CSI
 Indian Institute Of Technology,Roorkee

  --
 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.




-- 
Aamir Khan | 3rd Year  | Computer Science  Engineering | IIT Roorkee

-- 
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: without using '-'

2011-09-27 Thread rajan
I found a way to get rid of that also.. instead of strcmp().. use any
self-created function pred()
int pred( int i)
{
   int count=0;
   int j=1;
   while(j!=i)
   {
  j++;count++;
   }

  return count;

}

so my solution
(pred(X) * B) + Y



-- 
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] Try on linux terminal

2011-09-27 Thread Suganya Palaniappan
Don't try this... :( :(


--Regards,
Sug@ny@...

-- 
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] print all numbers in a given range without using any loop statements, jump statements and recursion

2011-09-27 Thread surender sanke
print all numbers in a given range *without* using any loop statements, jump
statements and recursion

surender

-- 
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 - Median of a BST without using extra space and in O(n)

2011-09-27 Thread Gene
And you have to use the pointer-reversing trick to traverse the tree
because you don't have space for a stack.

On Sep 27, 4:52 am, anshu mishra anshumishra6...@gmail.com wrote:
 do the inorder traversal as soon as reached at n/2th element that will be
 median.

-- 
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] print all numbers in a given range without using any loop statements, jump statements and recursion

2011-09-27 Thread shady
discussed, kindly look at archives

On Tue, Sep 27, 2011 at 3:13 PM, surender sanke surend...@gmail.com wrote:

 print all numbers in a given range *without* using any loop statements,
 jump statements and recursion

 surender

 --
 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] Segment Tree Optimization

2011-09-27 Thread shady
http://tinyurl.com/6gqun4u

On Tue, Sep 27, 2011 at 2:32 PM, Aamir Khan ak4u2...@gmail.com wrote:



 On Tue, Sep 27, 2011 at 1:27 PM, sunny agrawal sunny816.i...@gmail.comwrote:

 implement segment tree with lazy propagation :)


 What do you mean by lazy propagation ?

 --
 Sunny Aggrawal
 B.Tech. V year,CSI
 Indian Institute Of Technology,Roorkee

  --
 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.




 --
 Aamir Khan | 3rd Year  | Computer Science  Engineering | IIT Roorkee


  --
 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] Try on linux terminal

2011-09-27 Thread shady
at some places there is restriction on the memory that can be utilized...
there such actions fail.

On Tue, Sep 27, 2011 at 3:40 PM, sukran dhawan sukrandha...@gmail.comwrote:

 nothing is gonna happen... just restart the system after it hangs unless u
 don put it in init :)


 On Tue, Sep 27, 2011 at 2:53 PM, Suganya Palaniappan 
 suganyapl...@gmail.com wrote:



 Don't try this... :( :(


 --Regards,
 Sug@ny@...



  --
 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] Try on linux terminal

2011-09-27 Thread sukran dhawan
nothing is gonna happen... just restart the system after it hangs unless u
don put it in init :)

On Tue, Sep 27, 2011 at 2:53 PM, Suganya Palaniappan suganyapl...@gmail.com
 wrote:



 Don't try this... :( :(


 --Regards,
 Sug@ny@...



  --
 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] Segment Tree Optimization

2011-09-27 Thread Tamanna Afroze
nice link::  @shady

-- 
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] Try on linux terminal

2011-09-27 Thread sukran dhawan
yup +1 to shady

On Tue, Sep 27, 2011 at 3:44 PM, shady sinv...@gmail.com wrote:

 at some places there is restriction on the memory that can be utilized...
 there such actions fail.


 On Tue, Sep 27, 2011 at 3:40 PM, sukran dhawan sukrandha...@gmail.comwrote:

 nothing is gonna happen... just restart the system after it hangs unless u
 don put it in init :)


 On Tue, Sep 27, 2011 at 2:53 PM, Suganya Palaniappan 
 suganyapl...@gmail.com wrote:



 Don't try this... :( :(


 --Regards,
 Sug@ny@...



  --
 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] MS Question - Median of a BST without using extra space and in O(n)

2011-09-27 Thread anshu mishra
int bstMedian(node *root, int n, int x)
{
if (node-left) return bstMedian(root-left, n, x);
x++;
if (x == n/2) return node-val;
if (node-right) return bstMedian(root-right, n, x);
}
call bstMedian(root, n, 0);

-- 
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] Samsung campus visit

2011-09-27 Thread vartika aggarwal
Someone pls let me know the questions asked asked in the written test and
interview of Samsung..its coming to NSIT tomorrow..

-- 
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] Re: MS Question - Median of a BST without using extra space and in O(n)

2011-09-27 Thread Gene
This requires O(n) extra space.

On Sep 27, 7:43 am, anshu mishra anshumishra6...@gmail.com wrote:
 int bstMedian(node *root, int n, int x)
 {
     if (node-left) return bstMedian(root-left, n, x);
     x++;
     if (x == n/2) return node-val;
     if (node-right) return bstMedian(root-right, n, x);}

 call bstMedian(root, n, 0);

-- 
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] Source Bits

2011-09-27 Thread rajeev bharshetty
Technical Interview :

   - Tell me about yourself ?



I emphasized more on my OpenSource projects and the Contribution to
Amarok ( Video Player Project ). I even stressed on my knowledge of
Qt Programming ( C++ library for Developing User Interfaces on Linux
Platform ).

   - What do you mean by OpenSource ?



 OpenSource softwares basically mean that the source code is open to
you which provides the user the power to change his system in a way he
likes.
 The quote I gave was

“ OpenSource Softwares make you the master of your system rather than
system mastering you” .


   - Tell me the basics of Qt Programming ?


Qt Programming http://en.wikipedia.org/wiki/Qt_(framework)

   - What do you mean by signals and slots in Qt?
   - How does Signals, slots and functions internally work in C++?
   - Then some concepts on C++ programming ( Virtual Functions , Virtual
   Destructors ( Their internal Working ) ?
   - Some basic concepts of Inheritence and Overriding with examples.
   - Some basic concepts on Semaphores and their working ( With
   Implementation).




HR Round :

HR round was on Skype Video chatting on a MacBook Pro ( Awesome).

   - Tell me about yourself ,your family and your extra curricular
   activities.
   - What do you know about SourceBits?
   - She asked my CET ranking and my aggregate in RVCE .
   - I was asked about my projects .
   - Why do you want to join SourceBits?
   - What are the other offers you got?


On Sun, Sep 25, 2011 at 11:51 AM, Manoj Bagari manojbag...@gmail.comwrote:

 first of all congrats rajeev for the placements :) :)
 rajeev can u please tell us in more detaill about the technical anr hr
 around
 can u find any differenence on giving hr through skype
 can u list questions that were asked in techinacal and hr around

 --
 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
Rajeev N B http://www.opensourcemania.co.cc

*Winners Don't do Different things , they do things Differently*

-- 
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] Samsung campus visit

2011-09-27 Thread rahul sharma
which one??(sel,siso,sisc)

On Tue, Sep 27, 2011 at 5:09 PM, vartika aggarwal 
vartika.aggarwa...@gmail.com wrote:

 Someone pls let me know the questions asked asked in the written test and
 interview of Samsung..its coming to NSIT tomorrow..

 --
 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.


-- 
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] Samsung campus visit

2011-09-27 Thread vartika aggarwal
Samsung Engineering Labs (SEL)..pls help if possible!

On Tue, Sep 27, 2011 at 5:52 PM, rahul sharma rahul23111...@gmail.comwrote:

 which one??(sel,siso,sisc)

 On Tue, Sep 27, 2011 at 5:09 PM, vartika aggarwal 
 vartika.aggarwa...@gmail.com wrote:

 Someone pls let me know the questions asked asked in the written test and
 interview of Samsung..its coming to NSIT tomorrow..

 --
 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.


  --
 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

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] symantec help...

2011-09-27 Thread sush57
can anyone tell about placement process of symantec,pune...they are
comin for our campus on 30th of this month...pls help...if symantec
has already visited ur campus pls do put few types of questions that
were asked...it would be really helpful...


regards,
s.sushaanth
BE-computer science
Madras Institute Of Technology

-- 
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] Source Bits

2011-09-27 Thread aditya kumar
rajeev hw much did  they offer u ?

On Tue, Sep 27, 2011 at 5:55 PM, rajeev bharshetty rajeevr...@gmail.comwrote:

 Technical Interview :

- Tell me about yourself ?



  I emphasized more on my OpenSource projects and the Contribution
 to Amarok ( Video Player Project ). I even stressed on my knowledge
 of Qt Programming ( C++ library for Developing User Interfaces on Linux
 Platform ).

- What do you mean by OpenSource ?



   OpenSource softwares basically mean that the source code is open
 to you which provides the user the power to change his system in a way he
 likes.
   The quote I gave was

  “ OpenSource Softwares make you the master of your system rather than
 system mastering you” .


- Tell me the basics of Qt Programming ?


 Qt Programminghttp://en.wikipedia.org/wiki/Qt_(framework)

- What do you mean by signals and slots in Qt?
- How does Signals, slots and functions internally work in C++?
- Then some concepts on C++ programming ( Virtual Functions , Virtual
Destructors ( Their internal Working ) ?
- Some basic concepts of Inheritence and Overriding with examples.
- Some basic concepts on Semaphores and their working ( With
Implementation).




 HR Round :

 HR round was on Skype Video chatting on a MacBook Pro ( Awesome).

- Tell me about yourself ,your family and your extra curricular
activities.
- What do you know about SourceBits?
- She asked my CET ranking and my aggregate in RVCE .
- I was asked about my projects .
- Why do you want to join SourceBits?
- What are the other offers you got?


 On Sun, Sep 25, 2011 at 11:51 AM, Manoj Bagari manojbag...@gmail.comwrote:

 first of all congrats rajeev for the placements :) :)
 rajeev can u please tell us in more detaill about the technical anr hr
 around
 can u find any differenence on giving hr through skype
 can u list questions that were asked in techinacal and hr around

 --
 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
 Rajeev N B http://www.opensourcemania.co.cc

 *Winners Don't do Different things , they do things Differently*

  --
 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] Source Bits

2011-09-27 Thread rajeev bharshetty
5.5 Lakhs

On Tue, Sep 27, 2011 at 7:01 PM, aditya kumar
aditya.kumar130...@gmail.comwrote:

 rajeev hw much did  they offer u ?


 On Tue, Sep 27, 2011 at 5:55 PM, rajeev bharshetty 
 rajeevr...@gmail.comwrote:

 Technical Interview :

- Tell me about yourself ?



  I emphasized more on my OpenSource projects and the Contribution
 to Amarok ( Video Player Project ). I even stressed on my knowledge
 of Qt Programming ( C++ library for Developing User Interfaces on Linux
 Platform ).

- What do you mean by OpenSource ?



   OpenSource softwares basically mean that the source code is open
 to you which provides the user the power to change his system in a way he
 likes.
   The quote I gave was

  “ OpenSource Softwares make you the master of your system rather
 than system mastering you” .


- Tell me the basics of Qt Programming ?


 Qt Programminghttp://en.wikipedia.org/wiki/Qt_(framework)

- What do you mean by signals and slots in Qt?
- How does Signals, slots and functions internally work in C++?
- Then some concepts on C++ programming ( Virtual Functions , Virtual
Destructors ( Their internal Working ) ?
- Some basic concepts of Inheritence and Overriding with examples.
- Some basic concepts on Semaphores and their working ( With
Implementation).




 HR Round :

 HR round was on Skype Video chatting on a MacBook Pro ( Awesome).

- Tell me about yourself ,your family and your extra curricular
activities.
- What do you know about SourceBits?
- She asked my CET ranking and my aggregate in RVCE .
- I was asked about my projects .
- Why do you want to join SourceBits?
- What are the other offers you got?


 On Sun, Sep 25, 2011 at 11:51 AM, Manoj Bagari manojbag...@gmail.comwrote:

 first of all congrats rajeev for the placements :) :)
 rajeev can u please tell us in more detaill about the technical anr hr
 around
 can u find any differenence on giving hr through skype
 can u list questions that were asked in techinacal and hr around

 --
 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
 Rajeev N B http://www.opensourcemania.co.cc

 *Winners Don't do Different things , they do things Differently*

  --
 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
Rajeev N B http://www.opensourcemania.co.cc

*Winners Don't do Different things , they do things Differently*

-- 
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 - Median of a BST without using extra space and in O(n)

2011-09-27 Thread anshu mishra
its not o(n) it is O(max height of tree) :P
i have not seen the constraint.

-- 
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] Samsung campus visit

2011-09-27 Thread sourabh jain
1, writin 50 que.. (20 frm DI, 5 frm Quanta, 25 frm puzzel)
2. technical written (20 frm c/c++, 5 frm DS, 5 frm OS)
3. technical interview ( c/c++, DS, OS)
4. HR interview (normal)


-- 
Regards
SOURABH KUMAR JAIN
MCA,  NIT RAIPUR
MOB.-+919993878717

-- 
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] Modified binary search

2011-09-27 Thread Decipher
A given sorted array is rotated unknown number of times , write a C/C++ code 
to find an element in the sorted array in O(log n) time .

I know the solution to this problem is through binary search , but don't 
know the exact solution . Please help !!

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/8G52D009NfUJ.
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] BST to DLL spirally

2011-09-27 Thread raju
Had this question been already discussed  .. someone pls give me the
algo/logic.


Given a Binary Tree, Convert it into Doubly Linked List where the nodes are
represented Spirally.

For Example :-

A
B C  ABCGED || ACBDEG
D E G




~raju

-- 
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-27 Thread praneethn
clock period=(slowest stage delay)+(Buffer delay).

slowest stage delay is 160 ns and Buffer delay is 5ns. Buffer delay will
always be there between two stages .

clock period=165ns.

In the pipelining the time it takes =(k+n-1) * (clock period)

k=number of stages and n=number of instructions(data items)

hence time it takes=(4+1000-1)*(165)=165.4 microsec



On Tue, Sep 27, 2011 at 11:51 AM, Aditya Virmani
virmanisadi...@gmail.comwrote:

 585 + (160 + 5)for slowest transactions *999 for the rest of the
 instructions!


 On Tue, Sep 27, 2011 at 12:49 AM, Gene gene.ress...@gmail.com 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 duman...@gmail.com 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 bagana.bharatku...@gmail.com
  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 sivavikne...@gmail.com
 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*
   bagana.bharatku...@gmail.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.


  --
 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] Samsung campus visit

2011-09-27 Thread rahul sharma
test ur c skill for c..ds simple and os simpleno need to prepare if
know basics...
25 dieasy.25 problem solving...
interviews will b easy to crack...once u done with test u have done 90%
all d best
On Tue, Sep 27, 2011 at 7:24 PM, sourabh jain sourabhjain...@gmail.comwrote:




 1, writin 50 que.. (20 frm DI, 5 frm Quanta, 25 frm puzzel)
 2. technical written (20 frm c/c++, 5 frm DS, 5 frm OS)
 3. technical interview ( c/c++, DS, OS)
 4. HR interview (normal)


 --
 Regards
 SOURABH KUMAR JAIN
 MCA,  NIT RAIPUR
 MOB.-+919993878717


  --
 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] Samsung campus visit

2011-09-27 Thread vartika aggarwal
Thanks! :-)

On Tue, Sep 27, 2011 at 7:45 PM, rahul sharma rahul23111...@gmail.comwrote:


 test ur c skill for c..ds simple and os simpleno need to prepare if
 know basics...
 25 dieasy.25 problem solving...
 interviews will b easy to crack...once u done with test u have done 90%
 all d best

 On Tue, Sep 27, 2011 at 7:24 PM, sourabh jain sourabhjain...@gmail.comwrote:




 1, writin 50 que.. (20 frm DI, 5 frm Quanta, 25 frm puzzel)
 2. technical written (20 frm c/c++, 5 frm DS, 5 frm OS)
 3. technical interview ( c/c++, DS, OS)
 4. HR interview (normal)


 --
 Regards
 SOURABH KUMAR JAIN
 MCA,  NIT RAIPUR
 MOB.-+919993878717


  --
 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

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] Re: Modified binary search

2011-09-27 Thread akanksha
/*
A program in which an array have an increasing sequence and an
decreasing sequence .
in these array search an element in o(n)time complexity
these is also called rotated array
*/
#includeiostream
#includecmath
#includestdlib.h
using namespace std;
void search(int *array,int intial_index,int last_index,int ele);
int main()
{
int array[]={8,9,18,19,22,25,36,2,3,5,6,7};

search(array,0,11,9);

return 0;
}
void search(int *a,int l,int r,int ele) //l:left and r:right
{
cout\nSearch in array :;
for(int i=l;i=r;i++)
couta[i]  ;
int mid=(int)(l+r)/2;

if(a[mid]==ele)
 { cout\n\nFound the element at indexmidendl;
return ;}
if(a[l]==ele)
 { cout\n\nFound the element at indexlendl;
return ;}
if(a[r]==ele)
 { cout\n\nFound the element at indexrendl;
return ;}

if(a[l]a[mid])
{
if(elea[l]  elea[mid])
search(a,l+1,mid-1,ele);
}
else
{
if(elea[l] || elea[mid])
search(a,l+1,mid-1,ele);
}


if(a[r]a[mid])
{
if(elea[r]  elea[mid])
search(a,mid+1,r-1,ele);
}
else
{
if(elea[r] || elea[mid])
search(a,mid+1,r-1,ele);
}




}

-- 
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-27 Thread Varun Nagpal
Thats right. Clock speed is governed by slowest processing stage + register
delay. With clock cycle of  (160+5) ns even the faster stages will be forced
to run slowly. As a result 1st instruction will take 165*4 ns and rest of
following 999 instructions will take 165*999 ns.

On Tue, Sep 27, 2011 at 4:03 PM, praneethn praneeth...@gmail.com wrote:


 clock period=(slowest stage delay)+(Buffer delay).

 slowest stage delay is 160 ns and Buffer delay is 5ns. Buffer delay will
 always be there between two stages .

 clock period=165ns.

 In the pipelining the time it takes =(k+n-1) * (clock period)

 k=number of stages and n=number of instructions(data items)

 hence time it takes=(4+1000-1)*(165)=165.4 microsec




 On Tue, Sep 27, 2011 at 11:51 AM, Aditya Virmani virmanisadi...@gmail.com
  wrote:

 585 + (160 + 5)for slowest transactions *999 for the rest of the
 instructions!


 On Tue, Sep 27, 2011 at 12:49 AM, Gene gene.ress...@gmail.com 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 duman...@gmail.com 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 bagana.bharatku...@gmail.com
  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 
 sivavikne...@gmail.comwrote:
 
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*
   bagana.bharatku...@gmail.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.


  --
 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 - Median of a BST without using extra space and in O(n)

2011-09-27 Thread vikas
a simple one is rabit-tortoise method, and using stackless traversal,
facing a lot of corner cases in coding this, can someone check this as
well?

On Sep 27, 6:41 pm, anshu mishra anshumishra6...@gmail.com wrote:
 its not o(n) it is O(max height of tree) :P
 i have not seen the constraint.

-- 
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 - Median of a BST without using extra space and in O(n)

2011-09-27 Thread Dheeraj Sharma
@anshu
can middle element can be found if the no. of nodes are not given...

On Tue, Sep 27, 2011 at 8:34 PM, vikas vikas.rastogi2...@gmail.com wrote:

 a simple one is rabit-tortoise method, and using stackless traversal,
 facing a lot of corner cases in coding this, can someone check this as
 well?

 On Sep 27, 6:41 pm, anshu mishra anshumishra6...@gmail.com wrote:
  its not o(n) it is O(max height of tree) :P
  i have not seen the constraint.

 --
 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*

-- 
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 - Median of a BST without using extra space and in O(n)

2011-09-27 Thread Sanjay Rajpal
Recursion also requires space, so the problem is how to traverse without
extra space.

Once this is done, nothing is left in the problem.
Sanju
:)



On Tue, Sep 27, 2011 at 8:35 AM, Dheeraj Sharma dheerajsharma1...@gmail.com
 wrote:

 @anshu
 can middle element can be found if the no. of nodes are not given...


 On Tue, Sep 27, 2011 at 8:34 PM, vikas vikas.rastogi2...@gmail.comwrote:

 a simple one is rabit-tortoise method, and using stackless traversal,
 facing a lot of corner cases in coding this, can someone check this as
 well?

 On Sep 27, 6:41 pm, anshu mishra anshumishra6...@gmail.com wrote:
  its not o(n) it is O(max height of tree) :P
  i have not seen the constraint.

 --
 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*



 --
 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] Samsung campus visit

2011-09-27 Thread Nitin
C questions there are 12 -13 questions given on internet it will be same as
it is given in the paper ,i dnt find a link right now otherwise do test ur c
skills thoruoghly all c questions will be from that book

On Tue, Sep 27, 2011 at 7:47 PM, vartika aggarwal 
vartika.aggarwa...@gmail.com wrote:

 Thanks! :-)


 On Tue, Sep 27, 2011 at 7:45 PM, rahul sharma rahul23111...@gmail.comwrote:


 test ur c skill for c..ds simple and os simpleno need to prepare
 if know basics...
 25 dieasy.25 problem solving...
 interviews will b easy to crack...once u done with test u have done 90%
 all d best

 On Tue, Sep 27, 2011 at 7:24 PM, sourabh jain 
 sourabhjain...@gmail.comwrote:




 1, writin 50 que.. (20 frm DI, 5 frm Quanta, 25 frm puzzel)
 2. technical written (20 frm c/c++, 5 frm DS, 5 frm OS)
 3. technical interview ( c/c++, DS, OS)
 4. HR interview (normal)


 --
 Regards
 SOURABH KUMAR JAIN
 MCA,  NIT RAIPUR
 MOB.-+919993878717


  --
 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

 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.


-- 
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 - Median of a BST without using extra space and in O(n)

2011-09-27 Thread Nitin Garg
Do inorder traversal, to find out the total no. of nodes.

Next time, do the inorder traversal but keeping the count of nodes visited
and stop when you visit n/2 nodes.

Non recursive In-order Traversal -

*inorder*(node)
  *while* hasleftchild(node) *do*
node = node.left
  *do*
visit(node)
*if* (hasrightchild(node)) *then*
  node = node.right
  *while* hasleftchild(node) *do*
node = node.left
*else*
  *while* node.parent ≠ *null* *and* node == node.parent.right *do*
node = node.parent
  node = node.parent
  *while* node ≠ *null*

Source: Wikipedia

On Tue, Sep 27, 2011 at 9:13 PM, Sanjay Rajpal srn...@gmail.com wrote:

 Recursion also requires space, so the problem is how to traverse without
 extra space.

 Once this is done, nothing is left in the problem.
 Sanju
 :)



 On Tue, Sep 27, 2011 at 8:35 AM, Dheeraj Sharma 
 dheerajsharma1...@gmail.com wrote:

 @anshu
 can middle element can be found if the no. of nodes are not given...


 On Tue, Sep 27, 2011 at 8:34 PM, vikas vikas.rastogi2...@gmail.comwrote:

 a simple one is rabit-tortoise method, and using stackless traversal,
 facing a lot of corner cases in coding this, can someone check this as
 well?

 On Sep 27, 6:41 pm, anshu mishra anshumishra6...@gmail.com wrote:
  its not o(n) it is O(max height of tree) :P
  i have not seen the constraint.

 --
 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*



 --
 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.




-- 
Nitin Garg

Personality can open doors, but only Character can keep them open

-- 
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 - Median of a BST without using extra space and in O(n)

2011-09-27 Thread Sanjay Rajpal
Since we are given pointer to root node, we can easily find the minimum
element in the tree.

This will be the first node in the inorder traversal, now use method to find
the inorder successor of a each node. Do it iteratively.

Complexity will be O(n log n) and O(n) if tree is skewed.

Correct me if m wrong.
Sanju
:)



On Tue, Sep 27, 2011 at 8:49 AM, Nitin Garg nitin.garg.i...@gmail.comwrote:

 Do inorder traversal, to find out the total no. of nodes.

 Next time, do the inorder traversal but keeping the count of nodes visited
 and stop when you visit n/2 nodes.

 Non recursive In-order Traversal -

 *inorder*(node)
   *while* hasleftchild(node) *do*
 node = node.left
   *do*
 visit(node)
 *if* (hasrightchild(node)) *then*
   node = node.right
   *while* hasleftchild(node) *do*
 node = node.left
 *else*
   *while* node.parent ≠ *null* *and* node == node.parent.right *do*
 node = node.parent
   node = node.parent
   *while* node ≠ *null*

 Source: Wikipedia

   On Tue, Sep 27, 2011 at 9:13 PM, Sanjay Rajpal srn...@gmail.com wrote:

   Recursion also requires space, so the problem is how to traverse
 without extra space.

 Once this is done, nothing is left in the problem.
 Sanju
 :)



 On Tue, Sep 27, 2011 at 8:35 AM, Dheeraj Sharma 
 dheerajsharma1...@gmail.com wrote:

 @anshu
 can middle element can be found if the no. of nodes are not given...


 On Tue, Sep 27, 2011 at 8:34 PM, vikas vikas.rastogi2...@gmail.comwrote:

 a simple one is rabit-tortoise method, and using stackless traversal,
 facing a lot of corner cases in coding this, can someone check this as
 well?

 On Sep 27, 6:41 pm, anshu mishra anshumishra6...@gmail.com wrote:
  its not o(n) it is O(max height of tree) :P
  i have not seen the constraint.

 --
 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*



 --
 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.




 --
 Nitin Garg

 Personality can open doors, but only Character can keep them open

 --
  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 - Median of a BST without using extra space and in O(n)

2011-09-27 Thread geeks
morris Inorder traversal can do the task i think

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/TujHItNRKowJ.
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 to DLL spirally

2011-09-27 Thread geeks
just use the two stacks here and do the level order traversal in spiral 
order and keep down prev pointer each time and just maintain the doubly 
linked i think it is pretty gud hint :)

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/iHbjfHkgHl4J.
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 height balance a binary search tree ?

2011-09-27 Thread Ankuj Gupta
Given a bst how to height balance it ?

-- 
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: BST to DLL spirally

2011-09-27 Thread Sini Mathew
use one Queue instead of stacks.
this was one of amazon written question for me

Sini

On Tue, Sep 27, 2011 at 10:09 PM, geeks ankurshukla.h...@gmail.com wrote:

 just use the two stacks here and do the level order traversal in spiral
 order and keep down prev pointer each time and just maintain the doubly
 linked i think it is pretty gud hint :)

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/iHbjfHkgHl4J.

 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: BST to DLL spirally

2011-09-27 Thread raju
using two stacks or using a queue and a stack ...  these are obvious
solutions ..

Just want to know if there exists an iterative way without extra space !!!
I should've mentioned these details earlier .. sorry for that !!

~raju

On Tue, Sep 27, 2011 at 10:09 PM, geeks ankurshukla.h...@gmail.com wrote:

 just use the two stacks here and do the level order traversal in spiral
 order and keep down prev pointer each time and just maintain the doubly
 linked i think it is pretty gud hint :)

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/iHbjfHkgHl4J.
 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] Frequency of number

2011-09-27 Thread Ankuj Gupta
Infinite numbers are coming in a stream .  how will you find the
frequency of a given number ?

-- 
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] How to height balance a binary search tree ?

2011-09-27 Thread sukran dhawan
avl tree

On Tue, Sep 27, 2011 at 10:15 PM, Ankuj Gupta ankuj2...@gmail.com wrote:

 Given a bst how to height balance it ?

 --
 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] How to height balance a binary search tree ?

2011-09-27 Thread Ankur Garg
L , R ,LR , RL rotations

On Tue, Sep 27, 2011 at 10:35 PM, sukran dhawan sukrandha...@gmail.comwrote:

 avl tree


 On Tue, Sep 27, 2011 at 10:15 PM, Ankuj Gupta ankuj2...@gmail.com wrote:

 Given a bst how to height balance it ?

 --
 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] First non-repeated character complexity?

2011-09-27 Thread Avenged
could you please provide a working code please ?? this question was asked by 
MS a month back in our college.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/y1O61E41DW4J.
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] First non-repeated character complexity?

2011-09-27 Thread Avenged
Right so the complexity is O(n) Time and O(1) space. Could you tell how to 
check the repeatedness of the character using 1 bit at a time?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/bHxk_odaPlkJ.
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 height balance a binary search tree ?

2011-09-27 Thread Ankuj Gupta
We are given a tree so one should go for reconstruction of tree using
rotations ?

On Sep 27, 10:19 pm, Ankur Garg ankurga...@gmail.com wrote:
 L , R ,LR , RL rotations

 On Tue, Sep 27, 2011 at 10:35 PM, sukran dhawan sukrandha...@gmail.comwrote:







  avl tree

  On Tue, Sep 27, 2011 at 10:15 PM, Ankuj Gupta ankuj2...@gmail.com wrote:

  Given a bst how to height balance it ?

  --
  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] Frequency of number

2011-09-27 Thread teja bala
If we are to find frequency of only one number let us say 35 in infinite
coming numbers , do xor operation with coming numbers If the result is 0
increment the value of temp variable by 1 if not scan next input until all
numbers are over.

On Tue, Sep 27, 2011 at 10:22 PM, Ankuj Gupta ankuj2...@gmail.com wrote:

 Infinite numbers are coming in a stream .  how will you find the
 frequency of a given number ?

 --
 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] First non-repeated character complexity?

2011-09-27 Thread shady
sorry, but code it yourself...

On Tue, Sep 27, 2011 at 10:56 PM, Avenged nitee...@gmail.com wrote:

 could you please provide a working code please ?? this question was asked
 by MS a month back in our college.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/y1O61E41DW4J.
 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] First non-repeated character complexity?

2011-09-27 Thread Geek-0
Could you just explain how to implement using bitset ? 

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/CckzrVcuv-kJ.
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] Try on linux terminal

2011-09-27 Thread Hatta
I tried in my company's server had to reboot the whole thing now I'm fired!!

no just kidding, but please don't send fork bombs to the public that's
not polite.
quite old thing actually. no big deal. please cut that off next time.


On Tue, Sep 27, 2011 at 7:10 AM, sukran dhawan sukrandha...@gmail.com wrote:
 nothing is gonna happen... just restart the system after it hangs unless u
 don put it in init :)

 On Tue, Sep 27, 2011 at 2:53 PM, Suganya Palaniappan
 suganyapl...@gmail.com wrote:


 Don't try this... :( :(

 --Regards,
 Sug@ny@...


 --
 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.




-- 
Hatta

-- 
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] Try on linux terminal

2011-09-27 Thread shady
agreed, people could be doing some very important stuff at times... i had
already tried it once on my coll. server, where it got crashed and after
that they put the restrictions on the memory for each user.

On Tue, Sep 27, 2011 at 11:35 PM, Hatta tmd...@gmail.com wrote:

 I tried in my company's server had to reboot the whole thing now I'm
 fired!!

 no just kidding, but please don't send fork bombs to the public that's
 not polite.
 quite old thing actually. no big deal. please cut that off next time.


 On Tue, Sep 27, 2011 at 7:10 AM, sukran dhawan sukrandha...@gmail.com
 wrote:
  nothing is gonna happen... just restart the system after it hangs unless
 u
  don put it in init :)
 
  On Tue, Sep 27, 2011 at 2:53 PM, Suganya Palaniappan
  suganyapl...@gmail.com wrote:
 
 
  Don't try this... :( :(
 
  --Regards,
  Sug@ny@...
 
 
  --
  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.
 



 --
 Hatta

 --
 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: Frequency of number

2011-09-27 Thread Ankuj Gupta
If we have to find frequency of say x inputs then ?

On Sep 27, 10:40 pm, teja bala pawanjalsa.t...@gmail.com wrote:
 If we are to find frequency of only one number let us say 35 in infinite
 coming numbers , do xor operation with coming numbers If the result is 0
 increment the value of temp variable by 1 if not scan next input until all
 numbers are over.







 On Tue, Sep 27, 2011 at 10:22 PM, Ankuj Gupta ankuj2...@gmail.com wrote:
  Infinite numbers are coming in a stream .  how will you find the
  frequency of a given number ?

  --
  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] Frequency of number

2011-09-27 Thread Yogesh Yadav
Take an array a[1000]input first 1000 values from the stream in it..
Here we are representing a unit time with help of space because 1000
elements in a stream will always come in constant time

So just count the occurrence of a given number in that array... then divide
the count with 1000 that will be frequency...

For more accuracy just increase the array size upto what accuracy you want
.



..



On Tue, Sep 27, 2011 at 11:10 PM, teja bala pawanjalsa.t...@gmail.comwrote:

 If we are to find frequency of only one number let us say 35 in infinite
 coming numbers , do xor operation with coming numbers If the result is 0
 increment the value of temp variable by 1 if not scan next input until all
 numbers are over.


 On Tue, Sep 27, 2011 at 10:22 PM, Ankuj Gupta ankuj2...@gmail.com wrote:

 Infinite numbers are coming in a stream .  how will you find the
 frequency of a given number ?

 --
 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] symantec

2011-09-27 Thread swetha rahul
can anyone tell the recruitment procedure of symantec?
what is the package?

-- 
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: Modified binary search

2011-09-27 Thread raju
Rotated array  = [ 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0 ]
find 1 using binary search ...

turns out we cant use binary search if we've repeated elements in rotated
array ...

~raju

On Tue, Sep 27, 2011 at 8:18 PM, akanksha akanksha.271...@gmail.com wrote:

 /*
 A program in which an array have an increasing sequence and an
 decreasing sequence .
 in these array search an element in o(n)time complexity
 these is also called rotated array
 */
 #includeiostream
 #includecmath
 #includestdlib.h
 using namespace std;
 void search(int *array,int intial_index,int last_index,int ele);
 int main()
 {
int array[]={8,9,18,19,22,25,36,2,3,5,6,7};

search(array,0,11,9);

return 0;
 }
 void search(int *a,int l,int r,int ele) //l:left and r:right
 {
cout\nSearch in array :;
for(int i=l;i=r;i++)
couta[i]  ;
int mid=(int)(l+r)/2;

if(a[mid]==ele)
 { cout\n\nFound the element at indexmidendl;
return ;}
if(a[l]==ele)
 { cout\n\nFound the element at indexlendl;
return ;}
if(a[r]==ele)
 { cout\n\nFound the element at indexrendl;
return ;}

if(a[l]a[mid])
{
if(elea[l]  elea[mid])
search(a,l+1,mid-1,ele);
}
else
{
if(elea[l] || elea[mid])
search(a,l+1,mid-1,ele);
}


if(a[r]a[mid])
{
if(elea[r]  elea[mid])
search(a,mid+1,r-1,ele);
}
else
{
if(elea[r] || elea[mid])
search(a,mid+1,r-1,ele);
 }




 }

 --
 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] accenture

2011-09-27 Thread Nitin
can anybody tell me about the pattern of accenture???is is worth going to
accenture as a fresher???

-- 
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: Modified binary search

2011-09-27 Thread sukhmeet singh
first find the place where the mismatch occours in the array linearly ..
like if the the array is in increasing sorted order than first find a
location where it violates this property

{8,9,18,19,22,25,36,2,3,5,6,7};

the property is violated at index 7
now u have 2 sorted arrays from index [0-6] and [7-11]
now use binary search on both of these arrays as both are sorted, and get
the answer.




On Wed, Sep 28, 2011 at 12:11 AM, raju nikutel...@gmail.com wrote:

 Rotated array  = [ 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0 ]
 find 1 using binary search ...

 turns out we cant use binary search if we've repeated elements in rotated
 array ...

 ~raju


 On Tue, Sep 27, 2011 at 8:18 PM, akanksha akanksha.271...@gmail.comwrote:

 /*
 A program in which an array have an increasing sequence and an
 decreasing sequence .
 in these array search an element in o(n)time complexity
 these is also called rotated array
 */
 #includeiostream
 #includecmath
 #includestdlib.h
 using namespace std;
 void search(int *array,int intial_index,int last_index,int ele);
 int main()
 {
int array[]={8,9,18,19,22,25,36,2,3,5,6,7};

search(array,0,11,9);

return 0;
 }
 void search(int *a,int l,int r,int ele) //l:left and r:right
 {
cout\nSearch in array :;
for(int i=l;i=r;i++)
couta[i]  ;
int mid=(int)(l+r)/2;

if(a[mid]==ele)
 { cout\n\nFound the element at indexmidendl;
return ;}
if(a[l]==ele)
 { cout\n\nFound the element at indexlendl;
return ;}
if(a[r]==ele)
 { cout\n\nFound the element at indexrendl;
return ;}

if(a[l]a[mid])
{
if(elea[l]  elea[mid])
search(a,l+1,mid-1,ele);
}
else
{
if(elea[l] || elea[mid])
search(a,l+1,mid-1,ele);
}


if(a[r]a[mid])
{
if(elea[r]  elea[mid])
search(a,mid+1,r-1,ele);
}
else
{
if(elea[r] || elea[mid])
search(a,mid+1,r-1,ele);
 }




 }

 --
 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: Modified binary search

2011-09-27 Thread Gene
Indeed you must be given that all the array elements are unique or at
least that there are no more than floor(n/2) repeats). Otherwise this
is impossible.  The simplest way to think about it is first to search
for i such that a[i]  a[i+1].  At that point you know there are two
sorted ranges a[0]..a[i] and a[i+1] to a[n-1], so you can use regular
binary search on each of these pieces.

So how to find i?  This is itself a binary search. At each stage,
check whether a[0]  a[mid] and a[mid]  a[n-1].  The half that passes
this test contains i.  So throw away the other.

On Sep 27, 10:01 am, Decipher ankurseth...@gmail.com wrote:
 A given sorted array is rotated unknown number of times , write a C/C++ code
 to find an element in the sorted array in O(log n) time .

 I know the solution to this problem is through binary search , but don't
 know the exact solution . Please 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.



[algogeeks] Amazon Ques

2011-09-27 Thread Ankur Garg
 Print Reverse of linked list (dont reverse it) with only constant space.

Recursion uses stack spaceO(n) ..so post some other solution ..

-- 
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 Ques

2011-09-27 Thread anand karthik
Reverse it , print it and reverse it again. :-)

On Wed, Sep 28, 2011 at 3:28 AM, Ankur Garg ankurga...@gmail.com wrote:
 Print Reverse of linked list (dont reverse it) with only constant space.

 Recursion uses stack spaceO(n) ..so post some other solution ..


 --
 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.




-- 
Best,
T Anand Karthik,

Contact number: +91-9571552652

-- 
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 Ques

2011-09-27 Thread rahul sharma
reverse(head)
{
if(head==NUll)
{
printf(head-info);
return;
}
reverse(head-link)
printf(head-info);
}

On Wed, Sep 28, 2011 at 4:39 AM, anand karthik
anandkarthik@gmail.comwrote:

 Reverse it , print it and reverse it again. :-)

 On Wed, Sep 28, 2011 at 3:28 AM, Ankur Garg ankurga...@gmail.com wrote:
  Print Reverse of linked list (dont reverse it) with only constant space.
 
  Recursion uses stack spaceO(n) ..so post some other solution ..
 
 
  --
  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.
 



 --
 Best,
 T Anand Karthik,

 Contact number: +91-9571552652

 --
 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] accenture

2011-09-27 Thread rahul sharma
yeah although package is less initially but 6 month training is worth
learning.n a variety of projectsgreat brand...gud future growth
after 2 years

On Wed, Sep 28, 2011 at 1:14 AM, Nitin coolguyinat...@gmail.com wrote:

 can anybody tell me about the pattern of accenture???is is worth going to
 accenture as a fresher???

 --
 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 Ques

2011-09-27 Thread sukran dhawan
@rahul
if(head == null) return;

u cant print head-info when head is null

On Wed, Sep 28, 2011 at 8:20 AM, rahul sharma rahul23111...@gmail.comwrote:

 make sure that u ryt the syntax correct


 On Wed, Sep 28, 2011 at 8:18 AM, rahul sharma rahul23111...@gmail.comwrote:

 reverse(head)
 {
 if(head==NUll)
 {
 printf(head-info);
 return;
 }
 reverse(head-link)
 printf(head-info);
 }

 On Wed, Sep 28, 2011 at 4:39 AM, anand karthik 
 anandkarthik@gmail.com wrote:

 Reverse it , print it and reverse it again. :-)

 On Wed, Sep 28, 2011 at 3:28 AM, Ankur Garg ankurga...@gmail.com
 wrote:
  Print Reverse of linked list (dont reverse it) with only constant
 space.
 
  Recursion uses stack spaceO(n) ..so post some other solution ..
 
 
  --
  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.
 



 --
 Best,
 T Anand Karthik,

 Contact number: +91-9571552652

 --
 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 Ques

2011-09-27 Thread sukran dhawan
call function recursively when it is the last node, return the function
calls and print it

On Wed, Sep 28, 2011 at 8:20 AM, rahul sharma rahul23111...@gmail.comwrote:

 make sure that u ryt the syntax correct


 On Wed, Sep 28, 2011 at 8:18 AM, rahul sharma rahul23111...@gmail.comwrote:

 reverse(head)
 {
 if(head==NUll)
 {
 printf(head-info);
 return;
 }
 reverse(head-link)
 printf(head-info);
 }

 On Wed, Sep 28, 2011 at 4:39 AM, anand karthik 
 anandkarthik@gmail.com wrote:

 Reverse it , print it and reverse it again. :-)

 On Wed, Sep 28, 2011 at 3:28 AM, Ankur Garg ankurga...@gmail.com
 wrote:
  Print Reverse of linked list (dont reverse it) with only constant
 space.
 
  Recursion uses stack spaceO(n) ..so post some other solution ..
 
 
  --
  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.
 



 --
 Best,
 T Anand Karthik,

 Contact number: +91-9571552652

 --
 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] Find lowest common ancestor of Binary Tree

2011-09-27 Thread Ankuj Gupta
Find lowest common ancestor of Binary Tree

-- 
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] Find lowest common ancestor of Binary Tree

2011-09-27 Thread sukran dhawan
it has already been discussed .. search in the archives

On Wed, Sep 28, 2011 at 10:57 AM, Ankuj Gupta ankuj2...@gmail.com wrote:

 Find lowest common ancestor of Binary Tree

 --
 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.
 adFor 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: Qualcomm

2011-09-27 Thread siva viknesh
plz share the latest qualcomm questions and interview pattern if
anyone had attended

On Sep 25, 12:52 am, mohit mittal mohitm.1...@gmail.com wrote:
 Hello yar,
 Please share the written paper format and interview questions.
 If dont want to display openly, plz share with my id mohitm.1...@gmail.com.

 It will be of great help to me.

-- 
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: Qualcomm

2011-09-27 Thread Udit Gupta
forget dude if u not an iitian, then forget about qualcomm

On Wed, Sep 28, 2011 at 11:07 AM, siva viknesh sivavikne...@gmail.comwrote:

 plz share the latest qualcomm questions and interview pattern if
 anyone had attended

 On Sep 25, 12:52 am, mohit mittal mohitm.1...@gmail.com wrote:
  Hello yar,
  Please share the written paper format and interview questions.
  If dont want to display openly, plz share with my id
 mohitm.1...@gmail.com.
 
  It will be of great help to me.

 --
 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.