[algogeeks] Streya sexy video download

2010-09-22 Thread sakuntala v
Streya sexy video download
http://www.123maza.com/data-entry/amazoner

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

2010-09-22 Thread sakuntala v
Streya sexy video download
http://www.123maza.com/data-entry/amazoner

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

2010-09-22 Thread ramdas kale
If we take high = MAX_CAPACITY

Here MAX_CAPACITY denotes the maximum no of words dictinary can index.
Actual no of words stored in dictionary could be less than MAX_CAPACITY.

On Wed, Sep 22, 2010 at 1:23 AM, Minotauraus anike...@gmail.com wrote:

 high= const.(10^const)

 What's const? The point of this isn't that it's a difficult prob to
 solve. Point lies in working with the design to make this close to log
 n.

 Define what value const holds.

 On Sep 21, 9:12 am, coolfrog$ dixit.coolfrog.div...@gmail.com
 wrote:
  its dictionary means shorted ordered arry.
  let low = 1; and high= const.(10^const)
 
  Boolean isWord(String word)
 {  while(low = high)
  {   mid = (low+ high)/2;
  if(word = getWordAt(mid))
return true;
 if( word  getWordAt(mid))
 {  high = mid-1
 }
  else
   low = mid+1;
   }
 
   }
  Its a simple Binary Search Algorithm ...
 who's complexity is O(log n) times.

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




-- 
Ramdas Kale
+919983526790

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

2010-09-22 Thread Dave
Try something like this:

int FindMajority( int n , int a[] )
{
int majority = a[0];
int count = 1;
for( i = 1 ; i  n ; ++i )
{
if( a[i] == majority )
{
++count;
}
else
{
if( count == 0 )
{
 majority = a[i];
 count = 1;
}
else
{
 --count;
}
}
}
return majority;
}

It will find an element that occurs at least n/2 times in the array.
If you need to verify that the element occurs 2n/3 times, add a loop
to count the number of occurences of majority before the return.

On Sep 21, 10:42 pm, pre pre.la...@gmail.com wrote:
 Hi all,
 pls help me solve this problem..
 Design an algorithm to find the majority element of an array..
 majority element must be an element tht has the cardinality greater
 than 2n/3 where n is the number of elements in the array and the time
 complexity must be a linear time.. ie o(n)..

 hint : use mode or median to solve ..

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

2010-09-22 Thread Yellow Sapphire
In case of a dictionary, can we assume that its a Sorted list of
words?

On Sep 22, 12:42 pm, ramdas kale ramda...@gmail.com wrote:
 If we take high = MAX_CAPACITY

 Here MAX_CAPACITY denotes the maximum no of words dictinary can index.
 Actual no of words stored in dictionary could be less than MAX_CAPACITY.



 On Wed, Sep 22, 2010 at 1:23 AM, Minotauraus anike...@gmail.com wrote:
  high= const.(10^const)

  What's const? The point of this isn't that it's a difficult prob to
  solve. Point lies in working with the design to make this close to log
  n.

  Define what value const holds.

  On Sep 21, 9:12 am, coolfrog$ dixit.coolfrog.div...@gmail.com
  wrote:
   its dictionary means shorted ordered arry.
   let low = 1; and high= const.(10^const)

   Boolean isWord(String word)
      {  while(low = high)
           {   mid = (low+ high)/2;
                   if(word = getWordAt(mid))
                     return true;
                  if( word  getWordAt(mid))
                      {  high = mid-1
                      }
                   else
                        low = mid+1;
            }

    }
   Its a simple Binary Search Algorithm ...
      who's complexity is O(log n) times.

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

 --
 Ramdas Kale
 +919983526790

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

2010-09-22 Thread coolfrog$
DICTIONARY means sorted order! list!!

On Wed, Sep 22, 2010 at 7:21 AM, Yellow Sapphire pukhraj7...@gmail.comwrote:

 In case of a dictionary, can we assume that its a Sorted list of
 words?

 On Sep 22, 12:42 pm, ramdas kale ramda...@gmail.com wrote:
  If we take high = MAX_CAPACITY
 
  Here MAX_CAPACITY denotes the maximum no of words dictinary can index.
  Actual no of words stored in dictionary could be less than MAX_CAPACITY.
 
 
 
  On Wed, Sep 22, 2010 at 1:23 AM, Minotauraus anike...@gmail.com wrote:
   high= const.(10^const)
 
   What's const? The point of this isn't that it's a difficult prob to
   solve. Point lies in working with the design to make this close to log
   n.
 
   Define what value const holds.
 
   On Sep 21, 9:12 am, coolfrog$ dixit.coolfrog.div...@gmail.com
   wrote:
its dictionary means shorted ordered arry.
let low = 1; and high= const.(10^const)
 
Boolean isWord(String word)
   {  while(low = high)
{   mid = (low+ high)/2;
if(word = getWordAt(mid))
  return true;
   if( word  getWordAt(mid))
   {  high = mid-1
   }
else
 low = mid+1;
 }
 
 }
Its a simple Binary Search Algorithm ...
   who's complexity is O(log n) times.
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algoge...@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 algogeeks%2bunsubscr...@googlegroups.comalgogeeks%252bunsubscr...@googlegroups.com
 
   .
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
  --
  Ramdas Kale
  +919983526790

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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 algoge...@googlegroups.com.
To unsubscribe from 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: ALgo help pls

2010-09-22 Thread coolfrog$
solution in o(n log n)
 can be ( as if solution exit only one element cam be a majority element in
the given array)
1. sort the array in O(nlogn)
2.  x = a[2n/3]
  if(a[0]==x)
  {  if(x== a[(2n/3])+1)
return (x)
  }
On Wed, Sep 22, 2010 at 5:53 AM, Dave dave_and_da...@juno.com wrote:

 Try something like this:

 int FindMajority( int n , int a[] )
 {
int majority = a[0];
int count = 1;
for( i = 1 ; i  n ; ++i )
{
if( a[i] == majority )
{
++count;
}
else
{
if( count == 0 )
{
 majority = a[i];
 count = 1;
}
else
{
 --count;
}
}
}
return majority;
 }

 It will find an element that occurs at least n/2 times in the array.
 If you need to verify that the element occurs 2n/3 times, add a loop
 to count the number of occurences of majority before the return.

 On Sep 21, 10:42 pm, pre pre.la...@gmail.com wrote:
  Hi all,
  pls help me solve this problem..
  Design an algorithm to find the majority element of an array..
  majority element must be an element tht has the cardinality greater
  than 2n/3 where n is the number of elements in the array and the time
  complexity must be a linear time.. ie o(n)..
 
  hint : use mode or median to solve ..

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

2010-09-22 Thread rajess
sort boxes according to volume.volume pair consists of(l,b,h).
take first box having higher volume in sorted order with attribute
(l,b,h)
choose next volume box in sorted order.take its pair (l,b,h)
do a combination between these pairs comparing this attributes in all
possible ways and if their exists a combination break this and proceed
with next box and if no combination exists these boxes cant be packed.


combination means trying some way to achieve all elements in second
pair having one element greater than that in first pair..

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

2010-09-22 Thread Narsimha Raju
@coolfrogs: How can more than one element exist of 2n/3 times repeated..
@dave: can u add that for loop and send as i tried but could not succeed

On Wed, Sep 22, 2010 at 6:23 PM, coolfrog$
dixit.coolfrog.div...@gmail.comwrote:

 solution in o(n log n)
  can be ( as if solution exit only one element cam be a majority element in
 the given array)
 1. sort the array in O(nlogn)
 2.  x = a[2n/3]
   if(a[0]==x)
   {  if(x== a[(2n/3])+1)
 return (x)

   }
 On Wed, Sep 22, 2010 at 5:53 AM, Dave dave_and_da...@juno.com wrote:

 Try something like this:

 int FindMajority( int n , int a[] )
 {
int majority = a[0];
int count = 1;
for( i = 1 ; i  n ; ++i )
{
if( a[i] == majority )
{
++count;
}
else
{
if( count == 0 )
{
 majority = a[i];
 count = 1;
}
else
{
 --count;
}
}
}
return majority;
 }

 It will find an element that occurs at least n/2 times in the array.
 If you need to verify that the element occurs 2n/3 times, add a loop
 to count the number of occurences of majority before the return.

 On Sep 21, 10:42 pm, pre pre.la...@gmail.com wrote:
  Hi all,
  pls help me solve this problem..
  Design an algorithm to find the majority element of an array..
  majority element must be an element tht has the cardinality greater
  than 2n/3 where n is the number of elements in the array and the time
  complexity must be a linear time.. ie o(n)..
 
  hint : use mode or median to solve ..

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Regards,
C. Narsimha Raju
MS, IIIT Hyderabad.
http://research.iiit.ac.in/~narsimha_raju/

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

2010-09-22 Thread coolfrog$
@ Narsimha Raju : yes only one  such can element exit...
@Pre :
 Is there any algorithm to find median or mode in o(n)...
  because common approach are :

Find the Median of: 9, 3, 44, 17, 15 (Odd amount of numbers)
Line up your numbers: 3, 9, 15, 17, 44 (smallest to largest)
The Median is: 15 (The number in the middle)

Find the mode of:
9, 3, 3, 44, 17 , 17, 44, 15, 15, 15, 27, 40, 8,
Put the numbers is order for ease:
3, 3, 8, 9, 15, 15, 15, 17, 17, 27, 40, 44, 44,
The Mode is 15 (15 occurs the most at 3 times)

On Wed, Sep 22, 2010 at 8:01 AM, Narsimha Raju cnarsimhar...@gmail.comwrote:

 @coolfrogs: How can more than one element exist of 2n/3 times repeated..
 @dave: can u add that for loop and send as i tried but could not succeed

 On Wed, Sep 22, 2010 at 6:23 PM, coolfrog$ 
 dixit.coolfrog.div...@gmail.com wrote:

 solution in o(n log n)
  can be ( as if solution exit only one element cam be a majority element
 in the given array)
 1. sort the array in O(nlogn)
 2.  x = a[2n/3]
   if(a[0]==x)
   {  if(x== a[(2n/3])+1)
 return (x)

   }
 On Wed, Sep 22, 2010 at 5:53 AM, Dave dave_and_da...@juno.com wrote:

 Try something like this:

 int FindMajority( int n , int a[] )
 {
int majority = a[0];
int count = 1;
for( i = 1 ; i  n ; ++i )
{
if( a[i] == majority )
{
++count;
}
else
{
if( count == 0 )
{
 majority = a[i];
 count = 1;
}
else
{
 --count;
}
}
}
return majority;
 }

 It will find an element that occurs at least n/2 times in the array.
 If you need to verify that the element occurs 2n/3 times, add a loop
 to count the number of occurences of majority before the return.

 On Sep 21, 10:42 pm, pre pre.la...@gmail.com wrote:
  Hi all,
  pls help me solve this problem..
  Design an algorithm to find the majority element of an array..
  majority element must be an element tht has the cardinality greater
  than 2n/3 where n is the number of elements in the array and the time
  complexity must be a linear time.. ie o(n)..
 
  hint : use mode or median to solve ..

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Regards,
 C. Narsimha Raju
 MS, IIIT Hyderabad.
 http://research.iiit.ac.in/~narsimha_raju/http://research.iiit.ac.in/%7Enarsimha_raju/

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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 algoge...@googlegroups.com.
To unsubscribe from 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: ALgo help pls

2010-09-22 Thread Srinivas
Using hashing we can't do it?

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

2010-09-22 Thread Divesh Dixit
@Dave
  ya i got it heat -10 output through pipe tail -6.  but can u
explain foo??


On Sep 21, 10:25 pm, Dave dave_and_da...@juno.com wrote:
 If you can use both, it would be

 head -10 foo | tail -6

 It doesn't do the right thing if the file has fewer than 10 lines,
 though.

 Dave

 On Sep 21, 4:04 pm, Divesh Dixit dixit.coolfrog.div...@gmail.com
 wrote:

  How to get  line no. 5 to line no. 10  only from a file.. using tail
  or head command.?

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

2010-09-22 Thread rajess
sorry,no need combination trying also .take first and second set in
sorted list.
largest element in first set should be greater than largest element in
second set.
this repeated for second and third largest elements also in the set.if
this is satisfied,go for picking boxes i the sorted order of
volumes.if this is not satisfied at any case packing is not possible
with all given boxes










On Sep 22, 5:56 pm, rajess rajeshrules...@yahoo.com wrote:
 sort boxes according to volume.volume pair consists of(l,b,h).
 take first box having higher volume in sorted order with attribute
 (l,b,h)
 choose next volume box in sorted order.take its pair (l,b,h)
 do a combination between these pairs comparing this attributes in all
 possible ways and if their exists a combination break this and proceed
 with next box and if no combination exists these boxes cant be packed.

 combination means trying some way to achieve all elements in second
 pair having one element greater than that in first pair..

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from 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] Write C code for providing MAC address as output given the IP address as input

2010-09-22 Thread PCM
Write C code for providing MAC address as output given the IP address
as input..

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

2010-09-22 Thread Jinsong Huang
My solution.

int f(int n) {
if (n = 0) return n;
int digits = (int)log10(n) + 1;
int m = 0;
int flag[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
for (int i = digits - 1; i = 0; --i) {
int p = (int)pow(10.0, i);
int d = n / p;
n %= p;
if (flag[d]  0) continue;
flag[d] = 1;
m = 10 * m + d;
}
return m;
}

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

2010-09-22 Thread Divesh Dixit
These a reverse of binary search
1. iteration would be 1,2,4,8,16,32...
2. ex.   array a has the infinity 0's . Let it be n(very
large)
   count=1;
   for(i=1;in; i=(2^count))
 {if (a[i]==0)
   b[count]=1;
  }

   to decrypt it
 for (i=0;b[i]!=0;i++)
   {  print  2^i  Zeros 
  }
here space complexity is reduced to o(log n ) from O(n)...
imagine n to be 2^100 , you require just 100 memory location to
store them..

On Sep 15, 7:21 am, bittu shashank7andr...@gmail.com wrote:
 A file is given with many 0s stored in continuous way , store it in
 another file such that when you store try saving the space by using
 minimum amount of space. When you want to create the original file ,
 you should be able to do so with the new file created

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from 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: Inserting a box with lesser dimension into a box of bigger dimensions than that.

2010-09-22 Thread Yellow Sapphire
We can first sort the dimensions of each box.

For example if the dimensions of a box is L=10, B=12, W=6 then convert
it to L=12, B=10, W=6.

The above step is not needed if the problem states that LBH for all
boxes.

Then using a multi-key sorting we can sort all the boxes in ascending
order (or descending order).

If we sort it in ascending order:

This will give us a sorted list where in each box in the list is
smaller or equal to the next one in the list.

The boxes will fit inside the other one only if all the dimensions are
less than the other one.

Lets us have the boxes in list LIST in the sorted order (multi key)

//START

init_list (current)
init_list (discarded)

Start: // its a label.

for i = 0 to length_of_list; do //don't increment i here

T1=LIST[i]
T2=LIST[i+1]

if ( T1.L T2.L  T1.B  T2.B  T1.W  T2.W ) {

 add_to_tail (current, T1 , T2)
 i=i+2;

 } else {

   add_to_tail (discarded, T2)
   i++;
 }
done // for loop ends

print_list(current) // here is your one solution.

if ( elements in discarded list) {
LIST=discarded
goto Start // goto the label start
}

///END


On Sep 22, 12:11 am, Dave dave_and_da...@juno.com wrote:
 Certainly having a smaller volume is necessary for a box to fit in
 another box, but it is not sufficient. E.g., a box of size 1 x 1 x 1
 will not fit in a box of size 2 x 2 x 1/2.

 Dave

 On Sep 21, 1:16 pm, rajess rajeshrules...@yahoo.com wrote:

  find the volume of boxes as v=l*b*h
  sort boxes in volumes in descending order and this is the way to
  insert boxes one into another

  On Sep 21, 7:55 pm, Rashmi Shrivastava rash...@gmail.com wrote:

   If there are n number of boxes and each with different dimensions and your
   job is to insert one box having lesser dimension than that to another.
   Consider size of boxes as,
   b1-s1(h1,l1,w1)
   b2-s2(h2,l2,w2)
   .
   .
   .
   bn-sn(hn,ln,wn)- Hide quoted text -

  - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from 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: Inserting a box with lesser dimension into a box of bigger dimensions than that.

2010-09-22 Thread vikas kumar
you can search for box stacking problem in google. There is a DP
method.

On Sep 22, 12:11 am, Dave dave_and_da...@juno.com wrote:
 Certainly having a smaller volume is necessary for a box to fit in
 another box, but it is not sufficient. E.g., a box of size 1 x 1 x 1
 will not fit in a box of size 2 x 2 x 1/2.

 Dave

 On Sep 21, 1:16 pm, rajess rajeshrules...@yahoo.com wrote:



  find the volume of boxes as v=l*b*h
  sort boxes in volumes in descending order and this is the way to
  insert boxes one into another

  On Sep 21, 7:55 pm, Rashmi Shrivastava rash...@gmail.com wrote:

   If there are n number of boxes and each with different dimensions and your
   job is to insert one box having lesser dimension than that to another.
   Consider size of boxes as,
   b1-s1(h1,l1,w1)
   b2-s2(h2,l2,w2)
   .
   .
   .
   bn-sn(hn,ln,wn)- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -

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

2010-09-22 Thread Asit Baran Das
http://userweb.cs.utexas.edu/users/moore/best-ideas/mjrty/index.html

_Asit

On Wed, Sep 22, 2010 at 9:12 AM, pre pre.la...@gmail.com wrote:

 Hi all,
 pls help me solve this problem..
 Design an algorithm to find the majority element of an array..
 majority element must be an element tht has the cardinality greater
 than 2n/3 where n is the number of elements in the array and the time
 complexity must be a linear time.. ie o(n)..

 hint : use mode or median to solve ..

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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 algoge...@googlegroups.com.
To unsubscribe from 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 Question-Linux Shell

2010-09-22 Thread Minotauraus
That will also match 999.9.99.9 which isn't an ip address.

On Sep 21, 6:46 am, Neeraj 17.neera...@gmail.com wrote:
 *grep -R \[0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+\ * | awk -F':' '{print $1}' |
 uniq
 *
 works on my system :P









 On Tue, Sep 21, 2010 at 2:07 PM, Chi c...@linuxdna.com wrote:
  With perl installed:

   find directory | xargs perl -pi -e 's/needle/replace/g'

  With sed installed:

   #!/bin/bash

   find directory  mirror
   exec 3mirror

   while read file 3
   do
   replace=`more $file | sed -r -e 's/needle/replace/g'`
   cat $replace  $file
   done

  On Sep 19, 11:30 pm, bittu shashank7andr...@gmail.com wrote:
   Linux shell command to find all files in a directory which contain ip
   addresses

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

 --
 Neeraj

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

2010-09-22 Thread Navin Naidu
Use majority vote algorithm:

http://userweb.cs.utexas.edu/~moore/best-ideas/mjrty/index.html

On Wed, Sep 22, 2010 at 9:12 AM, pre pre.la...@gmail.com wrote:

 Hi all,
 pls help me solve this problem..
 Design an algorithm to find the majority element of an array..
 majority element must be an element tht has the cardinality greater
 than 2n/3 where n is the number of elements in the array and the time
 complexity must be a linear time.. ie o(n)..

 hint : use mode or median to solve ..

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




-- 
Thanks  Regards,

- NMN

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

2010-09-22 Thread rahul rai
printf(%d%d,scanf(%d%d,a b))

-- 
Rahul K Rai
rahulpossi...@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 algoge...@googlegroups.com.
To unsubscribe from 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] Help required

2010-09-22 Thread Nikhil Agarwal
@ankur Please give me a proper link.I mean with hash after 4shared.com

On Wed, Sep 22, 2010 at 11:26 AM, ankur aggarwal
ankur.mast@gmail.comwrote:

 http://www.4shared.com/
  check it..

 On Wed, Sep 22, 2010 at 12:00 AM, Nikhil Agarwal 
 nikhil.bhoja...@gmail.com wrote:

 Can anybody share his/her E-copy of An Introduction to algorithm by Udi
 manber.It's a great resource.If anybody has please share his E-copy.Thanks
 in advance.

 --
 Thanks  Regards
 Nikhil Agarwal
 Senior Undergraduate
 Computer Science  Engineering,
 National Institute Of Technology, Durgapur,India
 http://tech-nikk.blogspot.com
 http://beta.freshersworld.com/communities/nitd


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




 --

 With Regards
 Ankur Aggarwal
 +91-7838289304

 Software Engineer
 Slideshare
 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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Thanks  Regards
Nikhil Agarwal
Senior Undergraduate
Computer Science  Engineering,
National Institute Of Technology, Durgapur,India
http://tech-nikk.blogspot.com
http://beta.freshersworld.com/communities/nitd

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from 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: ind out which row has the maximum number of 1's in 2D array

2010-09-22 Thread vikas kumar

int getMaxOneRow()
{
...int maxOne = 0, maxRow = 0;
...for (curRow=0; curRowrowSize; curRow++)
...{
..int n = getOneCount(curRow);
..if(n  maxOne)
..{
.maxOne = n;
.maxRow = curRow;
..}
...}
return maxRow;
}

int getOneCount(int row)
{
...int count =0;
...for(int i =0; icolumnSize; i++)
...{
..if(matrix[row][i] == 1)
..{
..  count++;
..}
...}
}


time complexity O(n^2)
space complexity O(1)


On Sep 21, 9:51 pm, coolfrog$ dixit.coolfrog.div...@gmail.com
wrote:
 There is a 2 dimensional array with each cell containing a 0 or 1 ,
  Design an algorithm to
 find out which row has the maximum number of 1's , Your algorithm should
 have O(n2)
 time and no space complexity.

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

2010-09-22 Thread Nishant Agarwal
output will be
2 garbage_value

scanf returns numbers of inputs taken from std input and since there should
be 2 arguments in printf according to the format, so garbage value will
print

On Wed, Sep 22, 2010 at 2:25 PM, rahul rai raikra...@gmail.com wrote:

 printf(%d%d,scanf(%d%d,a b))

 --
 Rahul K Rai
 rahulpossi...@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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
 :-)
*
Nishant Agarwal
Computer Science and Engineering
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 algoge...@googlegroups.com.
To unsubscribe from 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: Unbounded dictionary lookup

2010-09-22 Thread vikas kumar
we can approach it like
*lets start with index 0
if (found)  return index
else
 index += INCR_;

*we will try to increment with INCR_ until one of the following
conditions met
  index goes out of bounds
  found the words which must come after the value eg meet should
occur prior to must
  found the word itself
*after above we will get some range to be searched for and we can
apply linear or binary search to find the string

the analysis will depend on the INCR_ and n values

hence worst case complexity will be
gertWordAt complexity multiplied by
O(log INCR_ ) binary search after range selection
O(n/INCR_)   searchinh for finding the correct range

Now you might want to have some logic to determine correct INCR_ value
if your dictionary is really changing at high frequency ;)



On Sep 22, 12:53 am, Minotauraus anike...@gmail.com wrote:
 high= const.(10^const)

 What's const? The point of this isn't that it's a difficult prob to
 solve. Point lies in working with the design to make this close to log
 n.

 Define what value const holds.

 On Sep 21, 9:12 am, coolfrog$ dixit.coolfrog.div...@gmail.com
 wrote:



  its dictionary means shorted ordered arry.
  let low = 1; and high= const.(10^const)

  Boolean isWord(String word)
     {  while(low = high)
          {   mid = (low+ high)/2;
                  if(word = getWordAt(mid))
                    return true;
                 if( word  getWordAt(mid))
                     {  high = mid-1
                     }
                  else
                       low = mid+1;
           }

   }
  Its a simple Binary Search Algorithm ...
     who's complexity is O(log n) times.- Hide quoted text -

 - Show quoted text -

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

2010-09-22 Thread sharad kumar
it accepts input into a,b an prints garbage value cos scanf returns the
number of values that accept nput ad in printf there is no variable from
where value is printed

On Wed, Sep 22, 2010 at 2:25 PM, rahul rai raikra...@gmail.com wrote:

 printf(%d%d,scanf(%d%d,a b))

 --
 Rahul K Rai
 rahulpossi...@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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
yezhu malai vaasa venkataramana Govinda Govinda

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

2010-09-22 Thread sharad kumar
hey ya man I was also searching for tat ione
, Sep 22, 2010 at 8:37 PM, Nikhil Agarwal nikhil.bhoja...@gmail.com wrote:

 @ankur Please give me a proper link.I mean with hash after 4shared.com

 On Wed, Sep 22, 2010 at 11:26 AM, ankur aggarwal ankur.mast@gmail.com
  wrote:

 http://www.4shared.com/
  check it..

  On Wed, Sep 22, 2010 at 12:00 AM, Nikhil Agarwal 
 nikhil.bhoja...@gmail.com wrote:

  Can anybody share his/her E-copy of An Introduction to algorithm by Udi
 manber.It's a great resource.If anybody has please share his E-copy.Thanks
 in advance.

 --
 Thanks  Regards
 Nikhil Agarwal
 Senior Undergraduate
 Computer Science  Engineering,
 National Institute Of Technology, Durgapur,India
 http://tech-nikk.blogspot.com
 http://beta.freshersworld.com/communities/nitd


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




 --

 With Regards
 Ankur Aggarwal
 +91-7838289304

 Software Engineer
 Slideshare
 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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Thanks  Regards
 Nikhil Agarwal
 Senior Undergraduate
 Computer Science  Engineering,
 National Institute Of Technology, Durgapur,India
 http://tech-nikk.blogspot.com
 http://beta.freshersworld.com/communities/nitd


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




-- 
yezhu malai vaasa venkataramana Govinda Govinda

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

2010-09-22 Thread ankur aggarwal
http://www.4shared.com/
 check it..

On Wed, Sep 22, 2010 at 12:00 AM, Nikhil Agarwal
nikhil.bhoja...@gmail.comwrote:

 Can anybody share his/her E-copy of An Introduction to algorithm by Udi
 manber.It's a great resource.If anybody has please share his E-copy.Thanks
 in advance.

 --
 Thanks  Regards
 Nikhil Agarwal
 Senior Undergraduate
 Computer Science  Engineering,
 National Institute Of Technology, Durgapur,India
 http://tech-nikk.blogspot.com
 http://beta.freshersworld.com/communities/nitd


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




-- 

With Regards
Ankur Aggarwal
+91-7838289304

Software Engineer
Slideshare
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 algoge...@googlegroups.com.
To unsubscribe from 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: Inserting a box with lesser dimension into a box of bigger dimensions than that.

2010-09-22 Thread Chi
This is also called bin packing. This is a NP-(Hard) problem. There is
no good algorithm to find a solution. All the code you published here
a heuristics. Here is a good tutorial:

 http://www.developerfusion.com/article/5540/bin-packing/

On Sep 22, 9:12 am, vikas kumar vikas.kumar...@gmail.com wrote:
 you can search for box stacking problem in google. There is a DP
 method.

 On Sep 22, 12:11 am, Dave dave_and_da...@juno.com wrote:

  Certainly having a smaller volume is necessary for a box to fit in
  another box, but it is not sufficient. E.g., a box of size 1 x 1 x 1
  will not fit in a box of size 2 x 2 x 1/2.

  Dave

  On Sep 21, 1:16 pm, rajess rajeshrules...@yahoo.com wrote:

   find the volume of boxes as v=l*b*h
   sort boxes in volumes in descending order and this is the way to
   insert boxes one into another

   On Sep 21, 7:55 pm, Rashmi Shrivastava rash...@gmail.com wrote:

If there are n number of boxes and each with different dimensions and 
your
job is to insert one box having lesser dimension than that to another.
Consider size of boxes as,
b1-s1(h1,l1,w1)
b2-s2(h2,l2,w2)
.
.
.
bn-sn(hn,ln,wn)- Hide quoted text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -

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



[algogeeks] Print 1 to n one per each line on the standard output

2010-09-22 Thread Divesh Dixit
Write an algorithm that will print 1 to n, one per each line on the
standard output, where n is
a integer parameter to the algorithm. An algorithm should not use
while, for, do-while
loops, goto statement, recursion, and switch statement.

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from 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: Inserting a box with lesser dimension into a box of bigger dimensions than that.

2010-09-22 Thread Mahendran MaheM
i dnt thnk it is gud to find the volume of the box,
becoz a best fit vol box may have higher length or hight or width,,,...
so LET  JUST TRY MY IDEA,.




step1:

first get that which box is taken to be first
insert that

step2:

then select all the boxes which having
  length length of the box jst insertd b4
  highthight jst  insertd b4
  widthwidth jst insertd b4 ..

step3:

and the rest unselectd box'z cn't be insert anymre...so remove that all...
coz some box'z may hv high length or hight or else width...

step4:

and than find the volume of all selectd box'z...
so that u can find which box having higher volume...

step5:

insert the higher volume box ..
this one will b the best fit...

step6:

goto the step 2..
til you dnt find  any more box'z to insert..
if thr is no box then end the process/...











On 9/22/10, Chi c...@linuxdna.com wrote:

 This is also called bin packing. This is a NP-(Hard) problem. There is
 no good algorithm to find a solution. All the code you published here
 a heuristics. Here is a good tutorial:

  http://www.developerfusion.com/article/5540/bin-packing/

 On Sep 22, 9:12 am, vikas kumar vikas.kumar...@gmail.com wrote:
  you can search for box stacking problem in google. There is a DP
  method.
 
  On Sep 22, 12:11 am, Dave dave_and_da...@juno.com wrote:
 
   Certainly having a smaller volume is necessary for a box to fit in
   another box, but it is not sufficient. E.g., a box of size 1 x 1 x 1
   will not fit in a box of size 2 x 2 x 1/2.
 
   Dave
 
   On Sep 21, 1:16 pm, rajess rajeshrules...@yahoo.com wrote:
 
find the volume of boxes as v=l*b*h
sort boxes in volumes in descending order and this is the way to
insert boxes one into another
 
On Sep 21, 7:55 pm, Rashmi Shrivastava rash...@gmail.com wrote:
 
 If there are n number of boxes and each with different dimensions
 and your
 job is to insert one box having lesser dimension than that to
 another.
 Consider size of boxes as,
 b1-s1(h1,l1,w1)
 b2-s2(h2,l2,w2)
 .
 .
 .
 bn-sn(hn,ln,wn)- Hide quoted text -
 
- Show quoted text -- Hide quoted text -
 
   - Show quoted text -

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




-- 
MAHEM

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



Re: [algogeeks] Print 1 to n one per each line on the standard output

2010-09-22 Thread Nishant Agarwal
void print_number(int n)
{ if(n=100)
  { printf(%d\n,n); print_number(n+1);}
}
main()
{ int n=1; print_number(n);}

this code is using recursion only.not loops, goto and switch
if anyone can do it without recursion then please post ur algo...
On Wed, Sep 22, 2010 at 9:19 PM, Divesh Dixit 
dixit.coolfrog.div...@gmail.com wrote:

 Write an algorithm that will print 1 to n, one per each line on the
 standard output, where n is
 a integer parameter to the algorithm. An algorithm should not use
 while, for, do-while
 loops, goto statement, recursion, and switch statement.

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




-- 
 :-)
*
Nishant Agarwal
Computer Science and Engineering
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 algoge...@googlegroups.com.
To unsubscribe from 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] help required...

2010-09-22 Thread Divesh Dixit
Among n people, a celebrity is defined as someone who is known to
everyone, but who knows no
one. Design and analyze to identify the celebrity, if one exists, by
asking only questions of the
following form: Excuse me, do you know person x? You will get a
binary answer for each such
question asked. Find the celebrity by asking only O(n) questions.

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

2010-09-22 Thread aswath G B
head -10 as.c | tail -6

Sample O/P

r...@hp-laptop:~/ds# *cat as.c*
#includestdio.h
int main()
{

 char a;
 int b;
 short c;
 double d;
 clrscr();
 a=b=0;
 c=d=1;
 a++;--b;c++;--d;
 printf(%p,%p,%p,%p,a,b,c,d);


}

r...@hp-laptop:~/ds# *head -10 as.c | tail -6*
 char a;
 int b;
 short c;
 double d;
 clrscr();
 a=b=0;

where as.c is input file head will return first 10 lines tail will return 6
lines from last

tats it



On Wed, Sep 22, 2010 at 2:34 AM, Divesh Dixit 
dixit.coolfrog.div...@gmail.com wrote:

 How to get  line no. 5 to line no. 10  only from a file.. using tail
 or head command.?

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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 algoge...@googlegroups.com.
To unsubscribe from 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] Dream Calc Scientific Edition

2010-09-22 Thread layla
DreamCalc Scientific Edition is the smarter alternative to a hand-held
Scientific Calculator for your PC or laptop! You'll get the intuitive
feel and productivity of using a professional hand-held, but one which
adapts to your way of working. Select from Reverse Polish Notation or
two styles of algebraic input, and with the optional ability to run in
your Windows system tray--DreamCalc will always be there whenever you
need to reach for a calculator. DreamCalc also offers you a full range
of scientific functions, statistics, complex numbers, base-n logic,
unit conversions, built-in constants and a powerful polynomial solver.
Because it is software, it allows you to exchange your results and
lists with your other applications. It is a must for business,
science, engineering and education.

LinK:
http://www.megaupload.com/?d=3DW93FAR

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



Re: [algogeeks] Print 1 to n one per each line on the standard output

2010-09-22 Thread balaji Ruler
#includeconio.h
#includestdio.h
void main()
{
int n,no=1;
clrscr();
printf(enter the limit:);
scanf(%d,n);
printf(%d\n,no);
while(no++n)
printf(%d\n,no);
getch();
}

On 9/22/10, Nishant Agarwal nishant.agarwa...@gmail.com wrote:
 void print_number(int n)
 { if(n=100)
   { printf(%d\n,n); print_number(n+1);}
 }
 main()
 { int n=1; print_number(n);}

 this code is using recursion only.not loops, goto and switch
 if anyone can do it without recursion then please post ur algo...
 On Wed, Sep 22, 2010 at 9:19 PM, Divesh Dixit 
 dixit.coolfrog.div...@gmail.com wrote:

 Write an algorithm that will print 1 to n, one per each line on the
 standard output, where n is
 a integer parameter to the algorithm. An algorithm should not use
 while, for, do-while
 loops, goto statement, recursion, and switch statement.

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




 --
  :-)
 *
 Nishant Agarwal
 Computer Science and Engineering
 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 algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
  :(*Livin wit hope*:(

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from 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: Print 1 to n one per each line on the standard output

2010-09-22 Thread Yellow Sapphire
The question is to get an algorithm or a program.

If it's a program then using execl() or fork() system call you can
code this.

The code will not be a recursion in a sense that we will not call
functions recursively but will call the programs (executable code)
recursively.

On Sep 22, 8:49 pm, Divesh Dixit dixit.coolfrog.div...@gmail.com
wrote:
 Write an algorithm that will print 1 to n, one per each line on the
 standard output, where n is
 a integer parameter to the algorithm. An algorithm should not use
 while, for, do-while
 loops, goto statement, recursion, and switch statement.

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

2010-09-22 Thread Dave
@Saurabh: Doesn't this turn 10 into 1? You need to count the digits in
the number as you are reversing it, and replace the second while loop
with a for loop with that many iterations.

Dave

On Sep 21, 11:28 pm, saurabh agrawal saurabh...@gmail.com wrote:
 @dave:
 your code is producing 4526 for input=24526 instead of 2456
 Here's corrected code :)
 /CODE///
 int function(int n){
     int a[10]={0},temp=0,result =0;
     while(n){           //reverse the number..
      temp=10*temp+n%10;
      n/=10;
     }
     n=temp;
     while(n){       ///remove duplicate digits...
              if(a[n%10]==0){
                      a[n%10]=1;
                      result=10*result+n%10;
              }
     n/=10;
     }
 return result;}

 ///END/



 On Wed, Sep 22, 2010 at 8:51 AM, Dave dave_and_da...@juno.com wrote:
  @Saurabh: Doesn't your code turn 123 into 321? Try this:

  int function(int n)
  {
     int a[10]={0};
     int result=0;
      int place=1;
      while(n){
         if(a[n%10]==0){
             a[n%10]=1;
              result+=(n%10)*place;
             place*=10;
         }
     n/=10;
     }
     return result;
  }

  Dave

  On Sep 21, 3:12 pm, saurabh agrawal saurabh...@gmail.com wrote:
   int function(int n){

   int a[10]={0};
   int result =0;
   while(n){
       if(a[n%10]==0){
           a[n%10]=1;
           result=10*result+n%10;
       }
       n/=10;}

   return result;`

   }
   On Wed, Sep 22, 2010 at 12:39 AM, Albert alberttheb...@gmail.com
  wrote:
Given a number find the number by eliminating the duplicate digits in
the number..

for eg:   24526  ans is 2456
.

int function(int n)
{

 .
 .
 .

}

Give all sort of solutions to this problem.

Efficiency in the code is important 

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

   - Show quoted text -

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

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from 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] Sure Shot Closure - Java Developer W/Pre-paid Credit Card Experience - NC - 6+months

2010-09-22 Thread hassan ali
*Sure Shot Closure - Java Developer with Pre-Paid Credit Card Experience*

Please send resume's @ *...@panzersolutions.com*

*Job Title: Java Developer
Location: Charlotte, NC
Duration: 6+months contract*

Need for Java developers with Pre-paid credit card experience
JAVA Script/Development for a Pre paid-Card App similar to a pre-loaded
payment card app but more like a limit-set credit card.
They must have experience with JAVA framework tools JAVA SPRING and JFC
which is a framework tool for developing portable GUI's.

*Regards,
Hassan Ali
ITSolutions
a...@panzersolutions.com*

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from 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] Very immediate need for a Tibco Systems Administrator - PA - 6+months

2010-09-22 Thread hassan ali
Very immediate need for a *Tibco Systems Administrator.*

*Send resume at* *...@panzersolutions.com*

*Job Title: Tibco Systems Administrator
Location: Bethlehem, PA
Duration:6+month contract*
*Rate :  $50/hr on C2C max
*
**
*After telephonic F2F required..*
**
*Experience:
*Minimum of six years of experience in IT
Minimum of three years of TIBCO Active Enterprise Administration
Experience implementing EAI/BPM tools and processes
Prior experience configuring TIBCO environments

Experience managing TIBCO domains and projects
Past experience with TIBCO in High Availability environment with clustering.

Proficient in UNIX shell Scripting and vi editor

Thanks,
Hassan Ali
Technical Recruiter
*...@panzersolutions.com*

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from 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] Anyone know optimized solution to bytelandian gold coins problem

2010-09-22 Thread venkatakrishna bandla
You are given a coin, which has an integer number written on it. A
coin valued n can be exchanged with me for three coins valued n/2, n/3
and n/4.
But these numbers are all rounded down to the integer value. You can
sell these coins for American dollars. The exchange rate is 1:1.

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

2010-09-22 Thread Dave
@Davesh: foo is the file name. Isn't foo frequently used as a file
name in Unix/Linix?

Dave

On Sep 22, 8:25 am, Divesh Dixit dixit.coolfrog.div...@gmail.com
wrote:
 @Dave
   ya i got it heat -10 output through pipe tail -6.  but can u
 explain foo??

 On Sep 21, 10:25 pm, Dave dave_and_da...@juno.com wrote:



  If you can use both, it would be

  head -10 foo | tail -6

  It doesn't do the right thing if the file has fewer than 10 lines,
  though.

  Dave

  On Sep 21, 4:04 pm, Divesh Dixit dixit.coolfrog.div...@gmail.com
  wrote:

   How to get  line no. 5 to line no. 10  only from a file.. using tail
   or head command.?- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from 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: Anyone know optimized solution to bytelandian gold coins problem

2010-09-22 Thread Dave
@Venkatakrishna: What is the problem? I don's see a question.

Dave

On Sep 22, 2:36 pm, venkatakrishna bandla
venkatakrishnabt...@gmail.com wrote:
 You are given a coin, which has an integer number written on it. A
 coin valued n can be exchanged with me for three coins valued n/2, n/3
 and n/4.
 But these numbers are all rounded down to the integer value. You can
 sell these coins for American dollars. The exchange rate is 1:1.

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

2010-09-22 Thread kartheek muthyala
Take 2 persons, suppose say A and B
ask one of them the question about other
if A Knows B, then A cannot be the celebrity,
if A does not know B, then B cannot be the celebrity.
add what remained to the remainder.

repeat this process for the remaining n-1 until one or none remained.

Then if it is none then there is no celebrity.
If there is one ask the question whether this person is known by remaining
n-1 and this person does n't know the remaining n-1. So a total of 3(n-1)
questions is used to determine the celeb.

Time complexity is O(n).

Repeat this for the remaining n-1 persons, if the remainder contain one
then

On Wed, Sep 22, 2010 at 9:37 PM, Divesh Dixit 
dixit.coolfrog.div...@gmail.com wrote:

 Among n people, a celebrity is defined as someone who is known to
 everyone, but who knows no
 one. Design and analyze to identify the celebrity, if one exists, by
 asking only questions of the
 following form: Excuse me, do you know person x? You will get a
 binary answer for each such
 question asked. Find the celebrity by asking only O(n) questions.

 --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algoge...@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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 algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.