Re: [algogeeks] Re: Infinite Array

2011-09-30 Thread Tamanna Afroze
as the array is sorted binary search is the best option...

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] urgent soln needed

2011-09-30 Thread rahul sharma
if matrix [i][j]=0
then entire row n column should be set to zero with min tym n space
complexity.o(n) tym n o
(1) space

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-30 Thread Anand Saha
http://www.geeksforgeeks.org/archives/1029

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.
 To unsubscribe from 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] urgent soln needed

2011-09-30 Thread Tamanna Afroze
if(matrix[i][j]==0){
  for(int j=0;jn;j++)
   matrix[i][j]=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] Find lowest common ancestor of Binary Tree

2011-09-30 Thread anshu mishra
node* LCA(node *root, node *n1, node *n2, int x)
{
int y = 0;
node *temp;

if (root-left) temp = LCA(root-left, n1, n2, y);
x += y;
if (temp != NULL) return temp;
if (x == 2) return node;

if (root-right) temp = LCA(root-right, n1, n2, y);
x += y;
if (temp != NULL) return temp;
if (x == 2) return node;

if (root == e1 || root == e2) x++;
return NULL:
}

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] SOURCEBITS :: EXPERIENCE

2011-09-30 Thread aditya kumar
1st round was a written test . It had 30 mcq's . This was the easiest mcq's
.
20 simple aptitude questions were thr along with some 10 C questions .

21 students were shortlisted for the first round .
in the interview round they asked me basics questions possibly from all the
subjects .
1) deadlock and their condition .
2) any three unix command .
3) dangling pointer and how to avoid dangling ptr .
4) osi layers , their function and protocols used in applocation layer
5) virtual function . and why are they needed .
6) process management .
7) l-value .(this is the only question where i couldnt find proper example
to explain )
8) lseek , what happens if do lseek after we have reached the end of a file
.
9) syntax of open command in unix .
10) features of oops and some real life example .
11) how to do data hiding in oops .

and few more question which i dint remember

For 15 mins he asked me about my project . He went into details of few of
them .
Since i had done my projects on android so i guess it added to my advantage
.

after the long four hour wait they announced shortlisted candidates for HR
round .
they short listed 13 out of 21.

In HR round :
This was very different Hr round as it was on skype that too video call.
Here you got to be very careful coz you dont have the liberty to properly
express yourself with hand gestures . There were basic HR questions .
Basically you need to sell yourself acc to thier needs . So i convinced them
with proper evidence and examples that i am kind of candidates they are
looking for . Its very important to go thru the comoany websites since then
only you can try explaining  them how you can fit into company needs .

It took them almost 36 hrs to announce the results .
Finally they short-listed 6 out of 13 .

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: How to Improve efficiency of this code? [SPOJ - HS11DIVS]

2011-09-30 Thread shady
got AC ?

On Fri, Sep 30, 2011 at 11:23 AM, .itoa nitm...@gmail.com wrote:

 *UPDATED  *the first() function. Instead of using a loop , using m=a%x and
 a = a-m+x to find the first divisible number.

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

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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 - array problem

2011-09-30 Thread Nitin Garg
Can we assume the output array is a new array and we can distort the
originial array???


On Fri, Sep 30, 2011 at 9:14 AM, praveen raj praveen0...@gmail.com wrote:

 Take two array... one will take care of left products... and othr will take
 care of right product.. at any index left[i]=A[i-1]*left[i-1]  starting
 from left and right[i]= A[i+1]*right[i+1] starting frm right……

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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: How to Improve efficiency of this code? [SPOJ - HS11DIVS]

2011-09-30 Thread .itoa
nope. It fails for large numbers. number can go upto 10^100. first off , how 
to input such large numbers in c/c++ ? 

-- 
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/-/T2qjkZm9uFkJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] need soln

2011-09-30 Thread rahul sharma
how to reverse c style strin g

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] urgent soln needed

2011-09-30 Thread rahul sharma
it will zero only row not column
On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze afroze...@gmail.comwrote:


 if(matrix[i][j]==0){
   for(int j=0;jn;j++)
matrix[i][j]=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.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: need soln

2011-09-30 Thread geeks
void reverse(char str[])
{
int i,j;
int n;
n=strlen(str);
for(i=0,j=n-1;ij;i++,,j--)
{
str[i]=str[i]+str[j];
str[j]=str[i]-str[j];
str[i]=str[i]-str[j];

}
}

-- 
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/-/ahYv91mn0X0J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] urgent soln needed

2011-09-30 Thread sumit kumar pathak
*find all the zeros in first iteration and store (size = array bool [2n])*
*and then make zero. *
*time = O(n^2)*
*space = O(n)*
*
*
*case 2:*
* if any zero whole matrix zero, (once we get a zero its row and column will
become zero which in turn lead to whole matrix being zero).
*
*
*regards
- Sumit Kumar Pathak
(Sumit/ Pathak/ SKP ...)
*Smile is only good contagious thing.*
*Spread it*!



On Fri, Sep 30, 2011 at 2:38 PM, rahul sharma rahul23111...@gmail.comwrote:

 it will zero only row not column

 On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze afroze...@gmail.comwrote:


 if(matrix[i][j]==0){
   for(int j=0;jn;j++)
matrix[i][j]=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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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: STRING help

2011-09-30 Thread Mohan Varma
There's no data type called string in C. Strings are represented as
plain char arrays with a null character '\0' at the end.All the string
functions like strlen() rely upon this convention.

I'm not much familiar to C++, but C++ has a string data type.

On Sep 30, 10:27 am, rahul sharma rahul23111...@gmail.com wrote:
 what is c style string??n wats diff b/w c and c++ strings
 representtaion..

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: STRING help

2011-09-30 Thread UTKARSH SRIVASTAV
NOC++  has only one additional data type that is bool.Rest everything is
designed as a class.
The c++ string is actually a class with overloaded operators..

On Fri, Sep 30, 2011 at 2:30 AM, Mohan Varma mohanvarm...@gmail.com wrote:

 There's no data type called string in C. Strings are represented as
 plain char arrays with a null character '\0' at the end.All the string
 functions like strlen() rely upon this convention.

 I'm not much familiar to C++, but C++ has a string data type.

 On Sep 30, 10:27 am, rahul sharma rahul23111...@gmail.com wrote:
  what is c style string??n wats diff b/w c and c++ strings
  representtaion..

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




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

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] urgent soln needed

2011-09-30 Thread Yogesh Yadav
Already discussed

https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=enlnk=gstq=MS+question+ankur#66bb2e804b43ae1d

.

On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak
sumitkp1...@gmail.comwrote:

 *find all the zeros in first iteration and store (size = array bool [2n])*
 *and then make zero. *
 *time = O(n^2)*
 *space = O(n)*
 *
 *
 *case 2:*
 * if any zero whole matrix zero, (once we get a zero its row and column
 will become zero which in turn lead to whole matrix being zero).
 *
 *
 *regards
 - Sumit Kumar Pathak
 (Sumit/ Pathak/ SKP ...)
 *Smile is only good contagious thing.*
 *Spread it*!




 On Fri, Sep 30, 2011 at 2:38 PM, rahul sharma rahul23111...@gmail.comwrote:

 it will zero only row not column

 On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze afroze...@gmail.comwrote:


 if(matrix[i][j]==0){
   for(int j=0;jn;j++)
matrix[i][j]=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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] quinstreet help......

2011-09-30 Thread sush57
can anyone post recruitment process of QuinStreet...that company is
coming on 19th oct...plz help friends..what type of questions can be
expectedplz help...thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: STRING help

2011-09-30 Thread rahul sharma
so reverse fun for ci.e user defines fxn will able to reverse c and c++
strings

On Fri, Sep 30, 2011 at 3:07 PM, UTKARSH SRIVASTAV
usrivastav...@gmail.comwrote:

 NOC++  has only one additional data type that is bool.Rest everything
 is designed as a class.
 The c++ string is actually a class with overloaded operators..


 On Fri, Sep 30, 2011 at 2:30 AM, Mohan Varma mohanvarm...@gmail.comwrote:

 There's no data type called string in C. Strings are represented as
 plain char arrays with a null character '\0' at the end.All the string
 functions like strlen() rely upon this convention.

 I'm not much familiar to C++, but C++ has a string data type.

 On Sep 30, 10:27 am, rahul sharma rahul23111...@gmail.com wrote:
  what is c style string??n wats diff b/w c and c++ strings
  representtaion..

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




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


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] urgent soln needed

2011-09-30 Thread rahul sharma
provide me with o(1) space ...i need it vey urgent.can it be done...thnx
in advance.

On Fri, Sep 30, 2011 at 3:44 PM, rahul sharma rahul23111...@gmail.comwrote:

 sorry n*m complex where n rows and m col
 but correct for space pzl and it uses two xtras array row and col


 On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma rahul23111...@gmail.comwrote:

 i cant find xact soln on previous threadi have sol with n*n complexity
  but used space,, i.e

 scan whole matrix
 if( matrix([i][j]==1)
 {
 row[i]=1;
 col[j]=1;
 }

 scan agin
 if(row[i]==1 ||| col[j]==1)
 matrix[i][j]=0;


 two n*n loops so takes n*n and uses space too plz give me opt. soln

 On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav medu...@gmail.com wrote:

 Already discussed


 https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=enlnk=gstq=MS+question+ankur#66bb2e804b43ae1d

 .


 On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak 
 sumitkp1...@gmail.com wrote:

 *find all the zeros in first iteration and store (size = array bool
 [2n])*
 *and then make zero. *
 *time = O(n^2)*
 *space = O(n)*
 *
 *
 *case 2:*
 * if any zero whole matrix zero, (once we get a zero its row and column
 will become zero which in turn lead to whole matrix being zero).
 *
 *
 *regards
 - Sumit Kumar Pathak
 (Sumit/ Pathak/ SKP ...)
 *Smile is only good contagious thing.*
 *Spread it*!




 On Fri, Sep 30, 2011 at 2:38 PM, rahul sharma 
 rahul23111...@gmail.comwrote:

 it will zero only row not column

 On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze 
 afroze...@gmail.comwrote:


 if(matrix[i][j]==0){
   for(int j=0;jn;j++)
matrix[i][j]=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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] urgent soln needed

2011-09-30 Thread rahul sharma
i cant find xact soln on previous threadi have sol with n*n complexity
 but used space,, i.e

scan whole matrix
if( matrix([i][j]==1)
{
row[i]=1;
col[j]=1;
}

scan agin
if(row[i]==1 ||| col[j]==1)
matrix[i][j]=0;


two n*n loops so takes n*n and uses space too plz give me opt. soln

On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav medu...@gmail.com wrote:

 Already discussed


 https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=enlnk=gstq=MS+question+ankur#66bb2e804b43ae1d

 .


 On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak sumitkp1...@gmail.com
  wrote:

 *find all the zeros in first iteration and store (size = array bool [2n])
 *
 *and then make zero. *
 *time = O(n^2)*
 *space = O(n)*
 *
 *
 *case 2:*
 * if any zero whole matrix zero, (once we get a zero its row and column
 will become zero which in turn lead to whole matrix being zero).
 *
 *
 *regards
 - Sumit Kumar Pathak
 (Sumit/ Pathak/ SKP ...)
 *Smile is only good contagious thing.*
 *Spread it*!




 On Fri, Sep 30, 2011 at 2:38 PM, rahul sharma rahul23111...@gmail.comwrote:

 it will zero only row not column

 On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze afroze...@gmail.comwrote:


 if(matrix[i][j]==0){
   for(int j=0;jn;j++)
matrix[i][j]=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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] urgent soln needed

2011-09-30 Thread rahul sharma
sorry n*m complex where n rows and m col
but correct for space pzl and it uses two xtras array row and col

On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma rahul23111...@gmail.comwrote:

 i cant find xact soln on previous threadi have sol with n*n complexity
  but used space,, i.e

 scan whole matrix
 if( matrix([i][j]==1)
 {
 row[i]=1;
 col[j]=1;
 }

 scan agin
 if(row[i]==1 ||| col[j]==1)
 matrix[i][j]=0;


 two n*n loops so takes n*n and uses space too plz give me opt. soln

 On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav medu...@gmail.com wrote:

 Already discussed


 https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=enlnk=gstq=MS+question+ankur#66bb2e804b43ae1d

 .


 On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak 
 sumitkp1...@gmail.com wrote:

 *find all the zeros in first iteration and store (size = array bool
 [2n])*
 *and then make zero. *
 *time = O(n^2)*
 *space = O(n)*
 *
 *
 *case 2:*
 * if any zero whole matrix zero, (once we get a zero its row and column
 will become zero which in turn lead to whole matrix being zero).
 *
 *
 *regards
 - Sumit Kumar Pathak
 (Sumit/ Pathak/ SKP ...)
 *Smile is only good contagious thing.*
 *Spread it*!




 On Fri, Sep 30, 2011 at 2:38 PM, rahul sharma 
 rahul23111...@gmail.comwrote:

 it will zero only row not column

 On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze 
 afroze...@gmail.comwrote:


 if(matrix[i][j]==0){
   for(int j=0;jn;j++)
matrix[i][j]=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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] Re: need soln

2011-09-30 Thread rahul sharma
i m doubtful...plz xplain

On Fri, Sep 30, 2011 at 2:44 PM, geeks ankurshukla.h...@gmail.com wrote:

 void reverse(char str[])
 {
 int i,j;
 int n;
 n=strlen(str);
 for(i=0,j=n-1;ij;i++,,j--)
 {
 str[i]=str[i]+str[j];
 str[j]=str[i]-str[j];
 str[i]=str[i]-str[j];

 }
 }

 --
 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/-/ahYv91mn0X0J.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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: SPOJ PIGBANK Problem

2011-09-30 Thread manish patel
thanks man i got it .. :)

On Fri, Sep 30, 2011 at 12:17 AM, Don dondod...@gmail.com wrote:

 I think that it will fail if the value of the coins can be more than
 50001.
 Don

 On Sep 29, 12:35 pm, manish patel manispatel...@gmail.com wrote:
  http://www.spoj.pl/problems/PIGBANK/
 
  please suggest some test case where it fails ...
 
  [code]
  #includestdio.h
  main()
  {int t=0,n,e,f,i,j;
  int p[50002],w[10002];
  scanf(%d,t);
  while(t--)
  {scanf(%d %d,e,f);
  scanf(%d,n);
  for(i=0;in;i++)
  {scanf(%d %d,p[i],w[i]);
  }
  int min[f-e+2];
  for(i=e;i=f+2;i++)
  {min[i-e]=50001;
  }
  min[0]=0;
  for(i=e+1;i=f;i++)
  {for(j=0;jn;j++)
  {if(w[j]=(i-e) min[i-e-w[j]]+p[j]  min[i-e])
  min[i-e]=min[i-e-w[j]]+p[j];
 
  }
  }
  if(min[f-e]==50001||min[f-e]==0)
  printf(This is impossible.\n);
  else
  printf(The minimum amount of money in the piggy-bank is
  %d.\n,min[f-e]);
  }
  return 0;
 
  }
 
  [/code]
 
  --
  With Regards
 
  Manish Patel
  BTech
  Computer Science And Engineering
  National Institute of Technology -Allahabad

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
With Regards

Manish Patel
BTech
Computer Science And Engineering
National Institute of Technology -Allahabad

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] STRING help

2011-09-30 Thread rahul vatsa
c style string is just the char array which is null terminated.

On Fri, Sep 30, 2011 at 1:27 AM, rahul sharma rahul23111...@gmail.comwrote:

 what is c style string??n wats diff b/w c and c++ strings
 representtaion..

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] Sapient Help!!

2011-09-30 Thread Prags
@Akaknsha- hv sapient visited ur college ?? if yes , then what is its
procedure ?

On Wed, Sep 28, 2011 at 9:32 PM, Akanksha . akanksha...@gmail.com wrote:

 wrk culture is gud mostly.. if u want to do gud technical wrk den
 avoid dis company otherwise if u r interested in management or nething
 like dat den u can go for it..

 On Wed, Sep 28, 2011 at 8:15 PM, rohit rajuljain...@gmail.com wrote:
  Is anybody know about sapient working culture?
 
  --
  You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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] urgent soln needed

2011-09-30 Thread Ankur Garg
@Rahul
Scan the matrix and whenver u see  a[i][j]=0 put a[i]]0]=0 and a[0][j]=0

Meaning to say that put that row or column as 0

Now,
Scan the first row and first column and whereever u see a 0 make that column
and row 0 respectively

Eg

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

Answer shud be

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

Scan Array First After Scanning it become

0 1 0 0
0 1 0 1
0 1 1 1
Now Scan first row and for a[0][j]  make a[i][j] 0
so

0 1 0 0
0 1 0 0
0  1 0 0
Now scan column ..Remember to start from a[1][0] and a[0][1]

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

Hope it helps

Ankur

On Fri, Sep 30, 2011 at 3:47 PM, rahul sharma rahul23111...@gmail.comwrote:

 provide me with o(1) space ...i need it vey urgent.can it be
 done...thnx in advance.


 On Fri, Sep 30, 2011 at 3:44 PM, rahul sharma rahul23111...@gmail.comwrote:

 sorry n*m complex where n rows and m col
 but correct for space pzl and it uses two xtras array row and col


 On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma rahul23111...@gmail.comwrote:

 i cant find xact soln on previous threadi have sol with n*n
 complexity  but used space,, i.e

 scan whole matrix
 if( matrix([i][j]==1)
 {
 row[i]=1;
 col[j]=1;
 }

 scan agin
 if(row[i]==1 ||| col[j]==1)
 matrix[i][j]=0;


 two n*n loops so takes n*n and uses space too plz give me opt. soln

 On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav medu...@gmail.com wrote:

 Already discussed


 https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=enlnk=gstq=MS+question+ankur#66bb2e804b43ae1d

 .


 On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak 
 sumitkp1...@gmail.com wrote:

 *find all the zeros in first iteration and store (size = array bool
 [2n])*
 *and then make zero. *
 *time = O(n^2)*
 *space = O(n)*
 *
 *
 *case 2:*
 * if any zero whole matrix zero, (once we get a zero its row and
 column will become zero which in turn lead to whole matrix being zero).
 *
 *
 *regards
 - Sumit Kumar Pathak
 (Sumit/ Pathak/ SKP ...)
 *Smile is only good contagious thing.*
 *Spread it*!




 On Fri, Sep 30, 2011 at 2:38 PM, rahul sharma rahul23111...@gmail.com
  wrote:

 it will zero only row not column

 On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze afroze...@gmail.com
  wrote:


 if(matrix[i][j]==0){
   for(int j=0;jn;j++)
matrix[i][j]=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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] Sapient Help!!

2011-09-30 Thread Akanksha .
I m a 2011 passout n sapient had visited my clg in jan 2011.. first of
all, u ll go thru a written test consising of apti ( quant, logical
reasoning n english ) and one paper of c,ds n c++ combined... den u r
shortlisted for technical interview in which dey ask u some puzzles n
ques related to dbms, ds, os etc(depends on ur inteviewer),once u
clear ur technical round, u ll hav a hr interview which is also an
elimination round.. so prepare well n all d best :)

On Fri, Sep 30, 2011 at 4:59 PM, Prags onlypr...@gmail.com wrote:
 @Akaknsha- hv sapient visited ur college ?? if yes , then what is its
 procedure ?

 On Wed, Sep 28, 2011 at 9:32 PM, Akanksha . akanksha...@gmail.com wrote:

 wrk culture is gud mostly.. if u want to do gud technical wrk den
 avoid dis company otherwise if u r interested in management or nething
 like dat den u can go for it..

 On Wed, Sep 28, 2011 at 8:15 PM, rohit rajuljain...@gmail.com wrote:
  Is anybody know about sapient working culture?
 
  --
  You received this message because you are subscribed to the Google
  Groups Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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: Infinite Array

2011-09-30 Thread pssaravanan
If the length of the array s not known,v could not apply the binary
search to search for an element. i think following code will produce
better solution.

i = 0;
for(i = 0;A[i]  p A[i] !=NULL;i = (i+1)^2);
j = i;
i = sqrt(i)-1;
applybinarysearch(i,j);

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] urgent soln needed

2011-09-30 Thread rahul sharma
plz xplain result after first scaning

On Fri, Sep 30, 2011 at 5:05 PM, Ankur Garg ankurga...@gmail.com wrote:

 @Rahul
 Scan the matrix and whenver u see  a[i][j]=0 put a[i]]0]=0 and a[0][j]=0

 Meaning to say that put that row or column as 0

 Now,
 Scan the first row and first column and whereever u see a 0 make that
 column and row 0 respectively

 Eg

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

 Answer shud be

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

 Scan Array First After Scanning it become

 0 1 0 0
 0 1 0 1
 0 1 1 1
 Now Scan first row and for a[0][j]  make a[i][j] 0
 so

 0 1 0 0
 0 1 0 0
 0  1 0 0
 Now scan column ..Remember to start from a[1][0] and a[0][1]

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

 Hope it helps

 Ankur


 On Fri, Sep 30, 2011 at 3:47 PM, rahul sharma rahul23111...@gmail.comwrote:

 provide me with o(1) space ...i need it vey urgent.can it be
 done...thnx in advance.


 On Fri, Sep 30, 2011 at 3:44 PM, rahul sharma rahul23111...@gmail.comwrote:

 sorry n*m complex where n rows and m col
 but correct for space pzl and it uses two xtras array row and col


 On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma 
 rahul23111...@gmail.comwrote:

 i cant find xact soln on previous threadi have sol with n*n
 complexity  but used space,, i.e

 scan whole matrix
 if( matrix([i][j]==1)
 {
 row[i]=1;
 col[j]=1;
 }

 scan agin
 if(row[i]==1 ||| col[j]==1)
 matrix[i][j]=0;


 two n*n loops so takes n*n and uses space too plz give me opt. soln

 On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav medu...@gmail.comwrote:

 Already discussed


 https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=enlnk=gstq=MS+question+ankur#66bb2e804b43ae1d

 .


 On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak 
 sumitkp1...@gmail.com wrote:

 *find all the zeros in first iteration and store (size = array bool
 [2n])*
 *and then make zero. *
 *time = O(n^2)*
 *space = O(n)*
 *
 *
 *case 2:*
 * if any zero whole matrix zero, (once we get a zero its row and
 column will become zero which in turn lead to whole matrix being zero).
 *
 *
 *regards
 - Sumit Kumar Pathak
 (Sumit/ Pathak/ SKP ...)
 *Smile is only good contagious thing.*
 *Spread it*!




 On Fri, Sep 30, 2011 at 2:38 PM, rahul sharma 
 rahul23111...@gmail.com wrote:

 it will zero only row not column

 On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze 
 afroze...@gmail.com wrote:


 if(matrix[i][j]==0){
   for(int j=0;jn;j++)
matrix[i][j]=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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] urgent soln needed

2011-09-30 Thread rahul sharma
i cnt get logic...xplain mre.thnx in advnce

On Fri, Sep 30, 2011 at 6:16 PM, rahul sharma rahul23111...@gmail.comwrote:

 plz xplain result after first scaning


 On Fri, Sep 30, 2011 at 5:05 PM, Ankur Garg ankurga...@gmail.com wrote:

 @Rahul
 Scan the matrix and whenver u see  a[i][j]=0 put a[i]]0]=0 and a[0][j]=0

 Meaning to say that put that row or column as 0

 Now,
 Scan the first row and first column and whereever u see a 0 make that
 column and row 0 respectively

 Eg

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

 Answer shud be

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

 Scan Array First After Scanning it become

 0 1 0 0
 0 1 0 1
 0 1 1 1
 Now Scan first row and for a[0][j]  make a[i][j] 0
 so

 0 1 0 0
 0 1 0 0
 0  1 0 0
 Now scan column ..Remember to start from a[1][0] and a[0][1]

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

 Hope it helps

 Ankur


 On Fri, Sep 30, 2011 at 3:47 PM, rahul sharma rahul23111...@gmail.comwrote:

 provide me with o(1) space ...i need it vey urgent.can it be
 done...thnx in advance.


 On Fri, Sep 30, 2011 at 3:44 PM, rahul sharma 
 rahul23111...@gmail.comwrote:

 sorry n*m complex where n rows and m col
 but correct for space pzl and it uses two xtras array row and col


 On Fri, Sep 30, 2011 at 3:42 PM, rahul sharma 
 rahul23111...@gmail.comwrote:

 i cant find xact soln on previous threadi have sol with n*n
 complexity  but used space,, i.e

 scan whole matrix
 if( matrix([i][j]==1)
 {
 row[i]=1;
 col[j]=1;
 }

 scan agin
 if(row[i]==1 ||| col[j]==1)
 matrix[i][j]=0;


 two n*n loops so takes n*n and uses space too plz give me opt. soln

 On Fri, Sep 30, 2011 at 3:08 PM, Yogesh Yadav medu...@gmail.comwrote:

 Already discussed


 https://groups.google.com/group/algogeeks/browse_thread/thread/8a3e1a6665702f54/66bb2e804b43ae1d?hl=enlnk=gstq=MS+question+ankur#66bb2e804b43ae1d

 .


 On Fri, Sep 30, 2011 at 2:59 PM, sumit kumar pathak 
 sumitkp1...@gmail.com wrote:

 *find all the zeros in first iteration and store (size = array bool
 [2n])*
 *and then make zero. *
 *time = O(n^2)*
 *space = O(n)*
 *
 *
 *case 2:*
 * if any zero whole matrix zero, (once we get a zero its row and
 column will become zero which in turn lead to whole matrix being zero).
 *
 *
 *regards
 - Sumit Kumar Pathak
 (Sumit/ Pathak/ SKP ...)
 *Smile is only good contagious thing.*
 *Spread it*!




 On Fri, Sep 30, 2011 at 2:38 PM, rahul sharma 
 rahul23111...@gmail.com wrote:

 it will zero only row not column

 On Fri, Sep 30, 2011 at 12:25 PM, Tamanna Afroze 
 afroze...@gmail.com wrote:


 if(matrix[i][j]==0){
   for(int j=0;jn;j++)
matrix[i][j]=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.


  --
 You received this message because you are subscribed to the Google
 Groups Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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 

[algogeeks] stack help

2011-09-30 Thread rahul sharma
hw will u design a stack which will have push pop and min fxn...all should
operate in o(1) tymreplyn asap

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] stack help

2011-09-30 Thread sukran dhawan
already discussed.search in archives

On Fri, Sep 30, 2011 at 6:29 PM, rahul sharma rahul23111...@gmail.comwrote:

 hw will u design a stack which will have push pop and min fxn...all should
 operate in o(1) tymreplyn asap

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] Tally Solutions Review

2011-09-30 Thread Aditya Virmani
ne idea abt how r thy gonna conduct their interview rounds?

On Fri, Sep 30, 2011 at 12:18 AM, Sahil Garg garg.sahi...@gmail.com wrote:

 plz do tell..
 i also need sm intervw questions at the earliest..

 Sahil Garg
 Computer Engineering
 Delhi College of Engineering



 On Thu, Sep 29, 2011 at 12:26 PM, Chunky Garg g.chunkyg...@gmail.comwrote:

 Can anyone tell me about tally solutions pvt ltd.
 how is the company and growth in it..
 what all is asked in interviews..

 --
 Regards
 Chunky Garg

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] INTEL recruitment process

2011-09-30 Thread Aditya Virmani
college?


On Thu, Sep 29, 2011 at 10:33 PM, aditya kumar aditya.kumar130...@gmail.com
 wrote:

 Guys does any one hve the idea about INTEL interview process for CS
 students ?? The area they focus and types of question they ask .
 If any have any idea plz help !
 thnks

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] stack help

2011-09-30 Thread rahul sharma
plz post link as m not able to find it

On Fri, Sep 30, 2011 at 7:17 PM, sukran dhawan sukrandha...@gmail.comwrote:

 already discussed.search in archives

 On Fri, Sep 30, 2011 at 6:29 PM, rahul sharma rahul23111...@gmail.comwrote:

 hw will u design a stack which will have push pop and min fxn...all should
 operate in o(1) tymreplyn asap

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] Median in logn

2011-09-30 Thread Shruti Gupta
Given two sorted arrays of size n each. Find the median of the array
obtained after merging the above two arrays in complexity logn??


Shruti
Thapar University

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] Median in logn

2011-09-30 Thread NAMAN KOHLI
Hi

This question can be done by observing the fact that if you take median m1
of the first array and the median of the second array m2 then the median of
the sorted merged arrays can be found in the new array formed by :-

If m1  m2 taking the right of median m1 in the first array and the left
elements of the median of m2 in second array and vice versa.

This formation of new array can be again repeated via recursion and at the
last case you will get the median.

On Fri, Sep 30, 2011 at 8:03 PM, Shruti Gupta shruti.gupt...@gmail.comwrote:

 Given two sorted arrays of size n each. Find the median of the array
 obtained after merging the above two arrays in complexity logn??


 Shruti
 Thapar University

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Naman Kohli
Roll No. 2009027

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] Median in logn

2011-09-30 Thread Shravan Kumar
http://www.ihas1337code.com/2011/03/median-of-two-sorted-arrays.html

On Fri, Sep 30, 2011 at 8:03 PM, Shruti Gupta shruti.gupt...@gmail.comwrote:

 Given two sorted arrays of size n each. Find the median of the array
 obtained after merging the above two arrays in complexity logn??


 Shruti
 Thapar University

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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: Infinite Array

2011-09-30 Thread Ashima .
isnt this quest a lil wrong. coz suppose if i dnt know the length of an
array,then how will i  access the last element of the array.in such  a
case,i will almost traverse the whole memory and still not stop. coz
compiler does not give array out of bound exception.
Ashima
M.Sc.(Tech)Information Systems
4th year
BITS Pilani
Rajasthan




On Fri, Sep 30, 2011 at 6:06 PM, pssaravanan
saravananselvam...@gmail.comwrote:

 If the length of the array s not known,v could not apply the binary
 search to search for an element. i think following code will produce
 better solution.

 i = 0;
 for(i = 0;A[i]  p A[i] !=NULL;i = (i+1)^2);
 j = i;
 i = sqrt(i)-1;
 applybinarysearch(i,j);

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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]

2011-09-30 Thread balaji a
Tujdqgtvg gR

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: Infinite Array

2011-09-30 Thread Don
@Ashima: It is a hypothetical question assuming an infinite array,
which of course requires infinite memory. So don't worry about the
compiler and other practical considerations. In real life the mass of
the memory would cause it to collapse into a singularity long before
the compiler would become an issue. Because we know that the array is
sorted, we'll need a binary search at some point. But at first we
don't know the bounds of the search. We must first find an index in
the array which contains a value greater than or equal to the value
we're searching for. Then we can do a binary search. To find that
index, you could start at i=1 and double i until A[i] = the value you
are searching for. My method uses something like Newton's Method which
will converge more quickly in some cases. It assumes that the slope is
fairly consistent, which may or may not be a good assumption.

Don

On Sep 30, 10:00 am, Ashima . ashima.b...@gmail.com wrote:
 isnt this quest a lil wrong. coz suppose if i dnt know the length of an
 array,then how will i  access the last element of the array.in such  a
 case,i will almost traverse the whole memory and still not stop. coz
 compiler does not give array out of bound exception.
 Ashima
 M.Sc.(Tech)Information Systems
 4th year
 BITS Pilani
 Rajasthan

 On Fri, Sep 30, 2011 at 6:06 PM, pssaravanan
 saravananselvam...@gmail.comwrote:

  If the length of the array s not known,v could not apply the binary
  search to search for an element. i think following code will produce
  better solution.

  i = 0;
  for(i = 0;A[i]  p A[i] !=NULL;i = (i+1)^2);
  j = i;
  i = sqrt(i)-1;
  applybinarysearch(i,j);

  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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] stack help

2011-09-30 Thread Shravan Kumar
http://groups.google.com/group/algogeeks/browse_thread/thread/1dd628ee5e7939da/decedd114a26e564?hl=enlnk=gstq=stack+problem#

On Fri, Sep 30, 2011 at 7:41 PM, rahul sharma rahul23111...@gmail.comwrote:

 plz post link as m not able to find it


 On Fri, Sep 30, 2011 at 7:17 PM, sukran dhawan sukrandha...@gmail.comwrote:

 already discussed.search in archives

 On Fri, Sep 30, 2011 at 6:29 PM, rahul sharma rahul23111...@gmail.comwrote:

 hw will u design a stack which will have push pop and min fxn...all
 should operate in o(1) tymreplyn asap

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] amazon ques

2011-09-30 Thread manish kapur
u have to perform following tasks in O(1) time
1.)insertion
2.)deletion
3.)searching
no range of input numbers is given
wat data structure will you use?
if u use hashing wat will be the key and value pairs?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-30 Thread Devesh Mittal
Fibonacci Heaps

On Fri, Sep 30, 2011 at 9:14 PM, manish kapur manishkapur.n...@gmail.comwrote:

 u have to perform following tasks in O(1) time
 1.)insertion
 2.)deletion
 3.)searching
 no range of input numbers is given
 wat data structure will you use?
 if u use hashing wat will be the key and value pairs?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] can anybody tell me about the infibeam recruitment process??

2011-09-30 Thread tech rascal


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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-30 Thread Adi Srikanth
if space complexity is not a constraint..u can use any kind of hashing and
its function.depends on the kind of data we store..if its numbers go for
square or simple linear function


Regards,
Adi Srikanth.
Mob No 9887233349
Personal Pages: adisrikanth.co.nr


On Fri, Sep 30, 2011 at 9:43 PM, Devesh Mittal devesh.vey...@gmail.comwrote:

 Fibonacci Heaps


 On Fri, Sep 30, 2011 at 9:14 PM, manish kapur 
 manishkapur.n...@gmail.comwrote:

 u have to perform following tasks in O(1) time
 1.)insertion
 2.)deletion
 3.)searching
 no range of input numbers is given
 wat data structure will you use?
 if u use hashing wat will be the key and value pairs?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: Infinite Array

2011-09-30 Thread Adi Srikanth
if its an array, you can get the size of an array from sizeof(array) divided
by size of element typethen we can perform binary search

Regards,
Adi Srikanth.
Personal Pages: adisrikanth.co.nr


On Fri, Sep 30, 2011 at 8:47 PM, Don dondod...@gmail.com wrote:

 @Ashima: It is a hypothetical question assuming an infinite array,
 which of course requires infinite memory. So don't worry about the
 compiler and other practical considerations. In real life the mass of
 the memory would cause it to collapse into a singularity long before
 the compiler would become an issue. Because we know that the array is
 sorted, we'll need a binary search at some point. But at first we
 don't know the bounds of the search. We must first find an index in
 the array which contains a value greater than or equal to the value
 we're searching for. Then we can do a binary search. To find that
 index, you could start at i=1 and double i until A[i] = the value you
 are searching for. My method uses something like Newton's Method which
 will converge more quickly in some cases. It assumes that the slope is
 fairly consistent, which may or may not be a good assumption.

 Don

 On Sep 30, 10:00 am, Ashima . ashima.b...@gmail.com wrote:
  isnt this quest a lil wrong. coz suppose if i dnt know the length of an
  array,then how will i  access the last element of the array.in such  a
  case,i will almost traverse the whole memory and still not stop. coz
  compiler does not give array out of bound exception.
  Ashima
  M.Sc.(Tech)Information Systems
  4th year
  BITS Pilani
  Rajasthan
 
  On Fri, Sep 30, 2011 at 6:06 PM, pssaravanan
  saravananselvam...@gmail.comwrote:
 
   If the length of the array s not known,v could not apply the binary
   search to search for an element. i think following code will produce
   better solution.
 
   i = 0;
   for(i = 0;A[i]  p A[i] !=NULL;i = (i+1)^2);
   j = i;
   i = sqrt(i)-1;
   applybinarysearch(i,j);
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from 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 - array problem

2011-09-30 Thread raju
@nitin ..
Output array is not a new array ... you can do anything to input array ..

~raju

On Fri, Sep 30, 2011 at 1:24 PM, Nitin Garg nitin.garg.i...@gmail.comwrote:

 Can we assume the output array is a new array and we can distort the
 originial array???


 On Fri, Sep 30, 2011 at 9:14 AM, praveen raj praveen0...@gmail.comwrote:

 Take two array... one will take care of left products... and othr will
 take care of right product.. at any index left[i]=A[i-1]*left[i-1]
 starting from left and right[i]= A[i+1]*right[i+1] starting frm right……

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.



Re: [algogeeks] Re: SAP!!

2011-09-30 Thread Adi Srikanth
in our college SAP had a online test, technical interview(some basic DSA
questions) and HR round(Important here..they will verify how much interested
you are...)


Regards,
Adi Srikanth.
Mob No 9887233349
Personal Pages: adisrikanth.co.nr


On Wed, Aug 31, 2011 at 12:31 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:

 Anybody who has faced the SAP procedure, please share the knowledge.


 On Sun, Aug 28, 2011 at 1:48 AM, prasanna rockslife2...@gmail.com wrote:

 hi
 SAP coming to my college too.
 someone pls enlighten abt the selection procedure.

 On Aug 21, 8:26 pm, rashmi i rash...@gmail.com wrote:
  Hey, SAP is visiting our college. Any idea about the pattern of the
 campus
  selection  process? As in type of questions asked? Thanks
  --
  R@$!-!
  DoN'T LimIt Ur cHaLlEngeS, ChAlLenGe uR LImItS.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Nikhil Gupta
 Senior Co-ordinator, Publicity
 CSI, NSIT Students' Branch
 NSIT, New Delhi, India


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Amazon - array problem

2011-09-30 Thread Abraham
Can we replace the operator (/) with 1^(-n) ?

On Sep 30, 12:54 pm, raju nikutel...@gmail.com wrote:
 @nitin ..
 Output array is not a new array ... you can do anything to input array ..

 ~raju

 On Fri, Sep 30, 2011 at 1:24 PM, Nitin Garg nitin.garg.i...@gmail.comwrote:







  Can we assume the output array is a new array and we can distort the
  originial array???

  On Fri, Sep 30, 2011 at 9:14 AM, praveen raj praveen0...@gmail.comwrote:

  Take two array... one will take care of left products... and othr will
  take care of right product.. at any index left[i]=A[i-1]*left[i-1]
  starting from left and right[i]= A[i+1]*right[i+1] starting frm right……

  --
  You received this message because you are subscribed to the Google Groups
  Algorithm Geeks group.
  To post to this group, send email to algogeeks@googlegroups.com.
  To unsubscribe from 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.



Re: [algogeeks] Amazon - array problem

2011-09-30 Thread Nitin Garg
@raju - so it means the input array should be distorted to give the output
array.
Are you sure about it? i doubt if its possible.

On Fri, Sep 30, 2011 at 11:24 PM, raju nikutel...@gmail.com wrote:

 @nitin ..
 Output array is not a new array ... you can do anything to input array ..

 ~raju


 On Fri, Sep 30, 2011 at 1:24 PM, Nitin Garg nitin.garg.i...@gmail.comwrote:

 Can we assume the output array is a new array and we can distort the
 originial array???


 On Fri, Sep 30, 2011 at 9:14 AM, praveen raj praveen0...@gmail.comwrote:

 Take two array... one will take care of left products... and othr will
 take care of right product.. at any index left[i]=A[i-1]*left[i-1]
 starting from left and right[i]= A[i+1]*right[i+1] starting frm right……

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.




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



[algogeeks] Re: How to Improve efficiency of this code? [SPOJ - HS11DIVS]

2011-09-30 Thread .itoa
Bump.. Anybody?

-- 
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/-/MFYbEg6sUjAJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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 Improve efficiency of this code? [SPOJ - HS11DIVS]

2011-09-30 Thread shady
use strings to multiply and other stuff in C++/C
else use some other language

On Oct 1, 12:13 am, .itoa nitm...@gmail.com wrote:
 Bump.. Anybody?

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Amazon - array problem

2011-09-30 Thread Brijesh
int main() 
{ 
   int a[]={4,3,5,2,6};  // 1 4 12 60 120
   const int n=5;
   int temp=1,i;
   int b[5]={0};
   for(i=0;in;i++)
   {
 b[i]=temp;
 temp*=a[i];
   }
   temp=1;
   for(i=n-1;i=0;i--)
   {
 b[i]*=temp;
 temp*=a[i];
   }
   for(i=0;in;i++)
   cout b[i];
   }
O(n) time , O(n) space complexity
On Thursday, 29 September 2011 16:56:02 UTC+5:30, raju wrote:

 Given an integer array. { 1,2,3,4,5 } 
 Compute array containing elements 
 120,60,40,30,24 (2*3*4*5,1*3*4*5, 1*2*4*5, 1*2*3*5, 1*2*3*4) 

 We shouldn't use division operator( / )
 Time complexity O(n) .. Space complexity O(1) 


 ~raju


-- 
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/-/pnuv-BqiaBUJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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 - array problem

2011-09-30 Thread Hatta
char A[] = { 1,2,3,4,5 };
int algo(int b, int i) {
if(i == sizeof(A)) { return 1; }
int c = A[i];
int f = algo(b*c, i+1);
A[i] = b*f;
return f*c;
}


On Thu, Sep 29, 2011 at 8:26 AM, raju nikutel...@gmail.com wrote:
 Given an integer array. { 1,2,3,4,5 }
 Compute array containing elements
 120,60,40,30,24 (2*3*4*5,1*3*4*5, 1*2*4*5, 1*2*3*5, 1*2*3*4)
 We shouldn't use division operator( / )
 Time complexity O(n) .. Space complexity O(1)

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




-- 
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] amazon ques

2011-09-30 Thread SAMM
Linked List + Hash table will serve the purpose in O(1).

On 9/30/11, Adi Srikanth adisriika...@gmail.com wrote:
 if space complexity is not a constraint..u can use any kind of hashing and
 its function.depends on the kind of data we store..if its numbers go for
 square or simple linear function


 Regards,
 Adi Srikanth.
 Mob No 9887233349
 Personal Pages: adisrikanth.co.nr


 On Fri, Sep 30, 2011 at 9:43 PM, Devesh Mittal
 devesh.vey...@gmail.comwrote:

 Fibonacci Heaps


 On Fri, Sep 30, 2011 at 9:14 PM, manish kapur
 manishkapur.n...@gmail.comwrote:

 u have to perform following tasks in O(1) time
 1.)insertion
 2.)deletion
 3.)searching
 no range of input numbers is given
 wat data structure will you use?
 if u use hashing wat will be the key and value pairs?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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.




-- 
Somnath Singh

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] sony errcsn

2011-09-30 Thread bihari
plzzz tell me procedure about sony ercssn.
this compy will come in maah campus ..
s pl give me info about thispl

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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 Interns

2011-09-30 Thread shiva@Algo
Amazon is Coming in our college ,Plz sugeest which subjects and what topic
to focus for that ...

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Amazon Interns

2011-09-30 Thread .itoa
BST ,very Large Input data problems, graphs (dfs bfs ,etc).  which 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/-/xqxjYxJ3cP8J.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: sony errcsn

2011-09-30 Thread bihari
its urgent


On Oct 1, 9:31 am, bihari kumarvive...@gmail.com wrote:
 plzzz tell me procedure about sony ercssn.
 this compy will come in maah campus ..
 s pl give me info about thispl

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: sony errcsn

2011-09-30 Thread vivek bhardwaj
:(
On Sat, Oct 1, 2011 at 10:52 AM, shady sinv...@gmail.com wrote:

 would have helped had you posted it properly.


 On Sat, Oct 1, 2011 at 10:50 AM, bihari kumarvive...@gmail.com wrote:

 its urgent


 On Oct 1, 9:31 am, bihari kumarvive...@gmail.com wrote:
  plzzz tell me procedure about sony ercssn.
  this compy will come in maah campus ..
  s pl give me info about thispl

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: sony errcsn

2011-09-30 Thread vivek bhardwaj
if u knoe den temmee

On Sat, Oct 1, 2011 at 11:01 AM, vivek bhardwaj kumarvive...@gmail.comwrote:


 :(

 On Sat, Oct 1, 2011 at 10:52 AM, shady sinv...@gmail.com wrote:

 would have helped had you posted it properly.


 On Sat, Oct 1, 2011 at 10:50 AM, bihari kumarvive...@gmail.com wrote:

 its urgent


 On Oct 1, 9:31 am, bihari kumarvive...@gmail.com wrote:
  plzzz tell me procedure about sony ercssn.
  this compy will come in maah campus ..
  s pl give me info about thispl

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from 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] Google Interview Question

2011-09-30 Thread R@TH!$H
Hi,

I am attending Google interview on Monday. Please help me with sample
questions.

Thanks  Regards,
Rathish Kannan

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: Infinite Array

2011-09-30 Thread Shruti Gupta
We can use the following stategy:
We consider range = 1 and search for given X among those 1 nos, if not
found i.e. if Xa[range-1] , we increase range = range*2.
If such right end is found , where a[range-1]  X, then we are sure
that X is somewhere b/w index [0, range-1] . And now do simple
binary search.
So, complexity = finding the apt. right end. + finding X = log n + log
n = log n

Shruti

On Sep 30, 10:52 pm, Adi Srikanth adisriika...@gmail.com wrote:
 if its an array, you can get the size of an array from sizeof(array) divided
 by size of element typethen we can perform binary search

 Regards,
 Adi Srikanth.
 Personal Pages: adisrikanth.co.nr







 On Fri, Sep 30, 2011 at 8:47 PM, Don dondod...@gmail.com wrote:
  @Ashima: It is a hypothetical question assuming an infinite array,
  which of course requires infinite memory. So don't worry about the
  compiler and other practical considerations. In real life the mass of
  the memory would cause it to collapse into a singularity long before
  the compiler would become an issue. Because we know that the array is
  sorted, we'll need a binary search at some point. But at first we
  don't know the bounds of the search. We must first find an index in
  the array which contains a value greater than or equal to the value
  we're searching for. Then we can do a binary search. To find that
  index, you could start at i=1 and double i until A[i] = the value you
  are searching for. My method uses something like Newton's Method which
  will converge more quickly in some cases. It assumes that the slope is
  fairly consistent, which may or may not be a good assumption.

  Don

  On Sep 30, 10:00 am, Ashima . ashima.b...@gmail.com wrote:
   isnt this quest a lil wrong. coz suppose if i dnt know the length of an
   array,then how will i  access the last element of the array.in such  a
   case,i will almost traverse the whole memory and still not stop. coz
   compiler does not give array out of bound exception.
   Ashima
   M.Sc.(Tech)Information Systems
   4th year
   BITS Pilani
   Rajasthan

   On Fri, Sep 30, 2011 at 6:06 PM, pssaravanan
   saravananselvam...@gmail.comwrote:

If the length of the array s not known,v could not apply the binary
search to search for an element. i think following code will produce
better solution.

i = 0;
for(i = 0;A[i]  p A[i] !=NULL;i = (i+1)^2);
j = i;
i = sqrt(i)-1;
applybinarysearch(i,j);

--
You received this message because you are subscribed to the Google
  Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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.