Re: [algogeeks] Amazon question

2012-03-22 Thread Rujin Cao
@atul:
Anurag's code has illustrated the idea of O(sqrt(E)) solution.

One more thing to optimize is that we can safely break after finding the
first factor of E which is less than sqrt(E).
So the code could be changed to:

#include#include#include#include#includeusing
namespace std;#define INFY 17int main()
{
   int n, i, j;
   int val, minDiv, minDis;
   while(1)
   {
   cin >> n;
   minDis = INFY;
   for (i = n; i <= n+2; i++)
   {
   *for (j = sqrt(i * 1.0); j > 0; j--)*
   {
  if (i % j == 0  &&  minDis > (i/j - j) )
  {
 minDis = i/j - j;
 minDiv = j;
 val = i;
 *break;*
  }
   }
   }
   cout

Re: [algogeeks] Amazon question

2012-03-21 Thread Rujin Cao
One possible way is:

1) Put the three candidate number together into an array [n, n + 1, n + 2]
2) Iterate each element *E* in that array and test whether *E* is a prime
number
   2.1) If it is, there will be only one way to find the two numbers
product to be *E*, i.e.  {x = 1, y = E} OR {x = E, y = 1}, so the result is
E - 1
   2.2) Otherwise, we should choose x and y that are closest to the
sqrt of *E*, which is quite straight forward.
   E.g.  72 = 8 * 9 and 72 = 2 * 36  (2 < 8 and 36 > 9, so |9 -
8| < |36 - 2|)


So total time complexity is O(sqrt(E)).

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

2012-01-30 Thread Rujin Cao
@Mihir

Just understood what you were asking...

atul is nearly right. You got to remove the unused items from
LinkedList after calling "print(left,..") and "print(right, ..)",
which might contain more than one item.

Since I'm not a Java guy, I just wrote some snippet using F# to
illustrate the idea. Hope it helps.


type BinaryTree<'a> =
| Node of BinaryTree<'a> * BinaryTree<'a> * 'a
| None

 let rec PrintPath (root : BinaryTree<'a>) list =
match root with
| None -> ()
| Node(left, right, value) ->
let list = value :: list
PrintPath left list
PrintPath right list

if left = None && right = None then
printfn "%A" (List.rev list)

 let tree = Node(Node(Node(None, None, 1), Node(None, None, 5), 2), None, 7)
 let list = []
PrintPath tree list

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

2012-01-29 Thread Rujin Cao
Is the correct output   7 2 1 5 ?

Did you intend to print the leaf node ?

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

2012-01-27 Thread Rujin Cao
A  little thought about this:

Since there are four colors Red, Yellow, Green, or Blue , we can use 2-bit
to represent each color, say

00 -> Red
01 -> Yellow
10 -> Green
11 -> Blue

so in total,  1 byte (unsigned char in C++) should be enough.


For the logic of detecting hits and pHits, the bit operation involved can
be the XOR, i.e.
the XOR result will be zero, if the two color are identical.

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

2012-01-16 Thread Rujin Cao
It's not a good way to compare two floats directly using =, try something
like below:

http://ideone.com/c65Vl

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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] Sum of Four Numbers in an Array (Amazon)

2012-01-02 Thread Rujin Cao
Here is an O(n*n) time complexity solution with O(n*n) space cost.

The basic idea is using double hashing(hash+set):

Step 1:
Use two for loops to calculate the sum of two integers and store them
in the hash table, which also has an inner set storing the two
integers' index.

E.g. For array {100,200,300} the hash looks like:
,
<100+200, <0, 1>>
<100+300, <0, 2>>
<200+300, <1, 2>>

Step 2:
Use two for loops again to calculate sum of two integers, we called S.
Try to check the above hash whether there is an item with the value K-S
and no intersection with the inner set.

Sent from my Windows Phone
发件人: SAMMM
发送时间: 2012/1/2 1:34
收件人: Algorithm Geeks
主题: [algogeeks] Sum of Four Numbers in an Array (Amazon)
Given an array A[] and a integer num(K) . Need to find the combination
of four no's in the array whose sum is equal to num(K).

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

2011-10-11 Thread Rujin Cao
This looks like concatenation of Fibonacci sequence。




On Mon, Oct 10, 2011 at 3:34 PM, anand karthik
wrote:

> Hi,
>
> I dont remember the question text exactly but the following should
> convey it well
>
> The question:
>
> A number is said to be an additive number if it has the following format:
>
> 3268126844 : 32 6812 6844 :  32 + 6812 = 6844
> 123581321 : 1 2 3 5 8 13 21 : 1+2  = 3 , 2+3 = 5 , 3+5=8, 5+8 = 13, 8+13
> -21
> 347  : 3 4 7 : 3+4=7
> 122331234346746 : 122 3312 3434 6746 : 122 + 3312 = 3434 , 3312+3434  =
> 6746
>
>
> If the number is broken down into non zero ( 303 : 3+0 = 3 is not
> additive ) segments,and when these segments are taken in groups of
> consecutive 3 ,(so two digit or single digit inputs wont qualify), the
> first two should add up to the third number, such a number is called
> as an additive number.
>
> Given a range of numbers, print all the numbers  which are additive in
> the sequence.
>
> Give an approach other than brute force.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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] please explain

2011-06-30 Thread Rujin Cao
int maxdiff(int );
int maxdiff(int arr[]);

The signatures of  maxdiff function are  not the same.


On Fri, Jul 1, 2011 at 6:53 AM, ashwini singh  wrote:

> this code gives an error ([Warning] passing arg 1 of `maxdiff' makes
> integer from pointer without a cast) . Please explain the reasons.
>
>
> #include
> #include
> int maxdiff(int );
> main()
> {
>   int p,arr[]={2,4,1,6,23,4};
>   p=maxdiff(arr);
>   printf("\n MAX Diff is \t %d",p);
>   getch();
>   }
> int maxdiff(int arr[])
> {
> int diff=0,len,i,j;
> unsigned p;
> len=sizeof(arr)/sizeof(arr[0]);
> for(i=0;i {
>   for(j=i;j   {
>  p=arr[j]-arr[i];
>  if((p-diff)>0)
>  diff=p;
>   }
> }
> return diff;
> }
>
> --
> with regards,
> Ashwini kumar singh
> ECE Final yr.
> NIT 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] Re: Sorting Array

2011-06-26 Thread Rujin Cao
@ross:
It seems that after discretization , the time complexity still would be
O(nlogn).

The discretization idea is:
say there are 4 numbers, each of them is in the range[1, 16].
e.g.  12 3 12 15
You can do one time transverse to map each of them to a global increasing
index (hashing is the appropriate method)
12 ---> 1
3  --->  2
15 ---> 3

but we still need some data structure to hold the order of the numbers which
is still O(nlogn).

for this idea, using STL map would be much easier...

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

2011-06-26 Thread Rujin Cao
@ross:
I guess the orignal problem is that there are N numbers which are all in the
range [1, N * N], can you do the sorting in O(N) time complexity?

If this is true,  we can firstly  do the discretization and then do the
counting sort.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from 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: searching a number in circular sorted array

2011-06-10 Thread Rujin Cao
Binary search is sufficient for this particular case.
To help the explain, we assume the circular sorted array is ascending if
probably rotated. we use *d[0..n - 1]* to represent the array
with n elements and *v* to represent the searched number.

Observing the circular sorted sequence d[0..n - 1]:
6  ,7,8   ,1   ,2   ,3  ,4,5
we can find that:
1) d[0] >= d[n - 1]
2) there exists one x that d[0..x] is ascending and d[x + 1.. n - 1] is also
ascending


Using the rules above, we can simply get an binary search algorithm:
The C++ code is below:

http://fayaa.com/code/view/20170/

*C++语言*: Codee#20170 
#include 

using namespace std;

// Parameters:
// @d: is one circularly sorted array, it looks like 6, 7, 8, 1, 2, 3, 5, 6
// @v: is the searched number
// Returns: -1 if not found or return the index
int BinarySearch(int d[], int len, int v)
{
if(d == NULL || len <= 0)
return -1;
int left = 0, right = len - 1;
while(right - left > 1)
{
int mid = (left + right) >> 1;
if(d[mid] >= d[left])
{
if(v >= d[mid])
left = mid;
else if(v >= d[left])
right = mid;
else
left = mid;
}
else // d[mid] < d[left]
{
if(v < d[mid])
right = mid;
else if(v < d[left])
left = mid;
else
right = mid;
}
}

if(d[left] != v)
return -1;
return left;
}

int main()
{
int d[] = {6, 7, 8, 1, 2, 3, 4, 5};

for(int i = 0; i < 10; i++)
{
printf("%d: %d\n", i, BinarySearch(d, 8, i));
}

return 0;
}





2011/6/11 L 

> Use ternary search to find the minimum number. (In this case 1)
> Then you have two sorted arrays, one ascending and one descending.
> Now, you can apply binary search. First, check the number with the
> last element and the first element and chose the appropriate array for
> searching.
>
> Time complexity: O(log n)
> Space complexity: O(1).
>
> On Jun 10, 9:06 pm, coder dumca  wrote:
> > hi frndz
> >
> > given an array which is circularly sorted  like
> >
> > 6  ,7,8   ,1   ,2   ,3  ,4,5
> >  search a  given number.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

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



Re: [algogeeks] Re: type 'int' unexpected

2011-06-02 Thread Rujin Cao
There are basically two ways of calling sizeof:


sizeof unary-expression
sizeof ( type-name )



Parentheses is not bad, when you are not sure whether to add it or
not, just add it.


For your case, you should put parentheses around type int, and also
you can leave arr without parentheses. In total, you can use below two
ways to express:

sizeof(arr) / sizeof(int)
sizeof arr / sizeof(int)


Or simply

sizeof arr / sizeof arr[0]


*Reference:*
http://msdn.microsoft.com/en-us/library/4s7x1k91(v=VS.100).aspx
http://en.wikipedia.org/wiki/Sizeof

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

2011-06-02 Thread Rujin Cao
You may use the following programming tricksto do the float
number comparison.

1) a == b  =>  fabs(a - b) <= eps

2) a  <  b => b - a > eps

3) a <= b => b - a >= -eps

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

2011-06-01 Thread Rujin Cao
Q1. Hash  Table (http://en.wikipedia.org/wiki/Hash_table)
Time complexity O(n)   Space complexity O(n)

Q2. Count Sorting  (http://en.wikipedia.org/wiki/Counting_sort)
Time complexity  O(n + k) Space complexity O(k)   here k = 5

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

2011-04-26 Thread Rujin Cao
For more solutions, you can find here
http://www.topcoder.com/stat?c=round_overview&er=5&rd=14433


2011/4/27 abhishek jain 

> Hi,
>
> As TC is over, so now I can submit the code of above prob:
>
> import java.util.*;
> import java.util.regex.*;
> import java.text.*;
> import java.math.*;
>
>
> public class MathContest
> {
> public int countBlack(String ballSequence, int repetitions)
> {
>  int sl = ballSequence.length();
> int l = sl*repetitions;
> int a[] = new int[l];
>  for(int i=0;i {
>  for(int j=0;j {
>  if(ballSequence.charAt(j)=='W')
>  a[j+i*sl]=0;
> else
>  a[j+i*sl]=1;
> }
> }
>  int count=0;
> int i=0;
>  while(i {
> if(a[i]==0)
>  {
> for(int j=0;j<=(l-i-1)/2;j++)
> {
>  int temp = a[j+i+1];
> a[j+1+i]= a[l-1-j];
> a[l-j-1] = temp;
>  }
> }
> else
>  {
> for(int j=i+1;j {
>  if(a[j]==0) a[j]=1;
> else
> a[j]=0;
>  }
> count++;
> }
>  i++;
> }
> if(a[l-1]==1)
>  count++;
> return count;
>  }
>
> Thanks,
> Abhishek
>
> On Tue, Apr 26, 2011 at 11:03 PM, Arpit Sood  wrote:
>
>> @vaibhav he will be banned for sometime in topcoder if someone reports
>> about this, you can count on that.
>>
>>
>> On Tue, Apr 26, 2011 at 10:42 PM, saurabh singh wrote:
>>
>>>
>>> Asking solution for a question 4m a live coding match is..
>>> I am out of this topic.Apologies to anyone insulted 4m my side but i am
>>> firm on wat i said.Leave the decision on the conscience of other readers.
>>>
>>> On Tue, Apr 26, 2011 at 10:08 PM, vaibhav shukla <
>>> vaibhav200...@gmail.com> wrote:
>>>
 I dont know y u ppl are so much concerned.He has just asked the
 question.Did any one answered it ??No,then y r u taking pain.
 and I dont know  how is this a disgrace on spirit of  coding ??Is asking
 a question a disgrace ?rubbish.


 On Tue, Apr 26, 2011 at 10:04 PM, radha krishnan <
 radhakrishnance...@gmail.com> wrote:

> May be he s innocent
>
>
>
> On Tue, Apr 26, 2011 at 10:02 PM, saurabh singh 
> wrote:
>
>> And sincerely hope no one helps him in near future too..
>>
>> Disgrace on the spirit of coding
>> On Tue, Apr 26, 2011 at 9:38 PM, radha krishnan <
>> radhakrishnance...@gmail.com> wrote:
>>
>>> Are u mad man ?
>>> WTF ?
>>> wats ur TC handle ?
>>>
>>>
>>>
>>> On Tue, Apr 26, 2011 at 9:22 PM, Aakash Johari <
>>> aakashj@gmail.com> wrote:
>>>
 You can ask the solution after the contest. :)


 On Tue, Apr 26, 2011 at 8:50 AM, Gunjan Sharma <
 gunjan.khan...@gmail.com> wrote:

> @Kamlesh: In this world this thing is termed as cheating. I
> wish nobody helps u on this
>
>
> On Tue, Apr 26, 2011 at 9:17 PM, Saravanan T <
> mail2sarava...@gmail.com> wrote:
>
>> Post the question!
>>
>>
>> On Tue, Apr 26, 2011 at 7:38 PM, kamlesh yadav <
>> kamleshlu2...@gmail.com> wrote:
>>
>>> plaese be online at 8.30 pm today  if possible and please help
>>> me.
>>>
>>> On Tue, Apr 26, 2011 at 7:19 PM, kamlesh yadav <
>>> kamleshlu2...@gmail.com> wrote:
>>> > hello friends
>>> >  i NEED UR HUMBLE SUPPORT
>>> >
>>> >   I will post a question after an hour,
>>> if
>>> > anybody can solve it for me as early as possible (probably
>>> within 45
>>> > minutes), then please solve it and send it ti me. I urgently
>>> need it
>>> > my idkamleshlu2...@gmail.com
>>> >
>>> > --
>>> > You received this message because you are subscribed to the
>>> Google Groups "Algorithm Geeks" group.
>>> > To post to this group, send email to
>>> algogeeks@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> > For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>> Kamlesh Kumar Yadav
>>> MCA  Department of Computer Science
>>> Delhi 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.
>>

Re: [algogeeks] Cracking the IT interview: jump start your career with confidence

2011-04-24 Thread Rujin Cao
++

2011/4/25 D.N.Vishwakarma@IITR 

> please mail me too
>
> On Mon, Apr 25, 2011 at 8:02 AM, DIPANKAR DUTTA <
> dutta.dipanka...@gmail.com> wrote:
>
>> can Any one have  the link of the following book:
>> Cracking the IT interview: jump start your career with confidence  By M
>> Balasubramaniam
>>
>> --
>> Thanks and Regards,
>> --
>> *DIPANKAR DUTTA*
>> Visiting Research Scholar
>> Dept of Computing,
>> Macquarie University, Sydney, Australia
>> ph.no-+61 416381145
>> email: dipankar.du...@mq.edu.au
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> **With Regards
> Deoki Nandan Vishwakarma
> IITR MCA
> Mathematics Department*
> *
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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] Problem; print the largest subset of negative number in array of integers

2011-04-21 Thread Rujin Cao
I think O(n) is the best time complexity. Try to think about one sequence
with all negative numbers or positive numbers. we can't get the full
information without one time iteration, or we can just say the data reading
time will cost O(n).

2011/4/21 hary rathor 

> Problem; print the largest subset of negative number in array of integers
>
> i have code it in following way which is give solution in O(n) and and
> required memory in O(n)
>  any tell me other method better then this O(n) .
> pls tell me is it any bug in the code
>
>
> #include
>
> int count=0,ind=-1,len,i=0;
> void largestNegSubset(int arr[])
> {
> if(i>len)
> return ;
> int t=0;
> while(arr[i++]<0&&i<=len)t++;
> if(t>count){count=t;ind=i-1;}
> largestNegSubset(arr);
> }
> int main()
> {
> int arr[]={1,0,1,-6,-7,-2,-2,4,-3,-5,-6,7,-8,-9};
> len=(sizeof(arr)/sizeof(int));
> largestNegSubset(arr);
> for(i=ind-1;i>(ind-count-1);i--)
> printf("%d,",arr[i]);
> return 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.



Re: [algogeeks] books

2011-04-21 Thread Rujin Cao
FYI.

Someone is starting to translate the Chinese version in
http://pro.yeeyan.org/CRACKINGTHECODINGINTERVIEW


2011/4/21 LALIT SHARMA 

> Please mail me 2 ,
>
> my id is lks.ru...@gmail.com
>
> thnX in Advance ..
>
> On Thu, Apr 21, 2011 at 12:45 PM, kamlesh yadav 
> wrote:
> > can anyone give me  list of books  like ( cracking the coding
> > interview )
> >  for placement preparation
> >
> > 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.
> >
> >
>
>
>
> --
> Lalit Kishore Sharma,
> IIIT Allahabad (Amethi Capmus),
> 6th Sem.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from 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]

2011-04-21 Thread Rujin Cao
@riti:
You can change
*char *p="hello";*
to
*char p[] = "hello";*
then everything should be fine.

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