Find the maximum size Binary search tree in a binary tree??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
In a plane given n points (x1,y1) (x2,y2)(xn,yn), find the the
maximum number of collinear points.
--
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
Design a data structure to find the next higher element for each
element in an array.
For e.g. if array is 1 2 3 4 5 8 6
o/p should be
(element) (next higher element)
1 2
2 3
3 4
4 5
5 8
8 nothing
6 nothing
The array need not be sorted.
Constraints-O(n) time complexity
--
You received this
Given a list of n integers?(negative and positive), not sorted and
duplicates allowed, you have to output the triplets which sum upto 0.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
char a=10 01 11 01
a = a ^ ~ ( 0 )
//now a is 01 10 00 10
--
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
Manisha, this is not the desired result. -- Dave
On Jun 23, 6:26 am, manisha nandal manisha04.nan...@gmail.com wrote:
char a=10 01 11 01
a = a ^ ~ ( 0 )
//now a is 01 10 00 10
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
Given a lot of cuboid boxes with different length, breadth and height.
We need to find the maximum subset which can fit into each other.
For example:
If Box 1 has LBH as 7 8 9
If Box 2 has LBH as 5 6 8
If Box 3 has LBH as 5 8 7
If Box 4 has LBH as 4 4 4
then answer is 1,2,4
A box can fit into
it is 29! / 23!
--
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
hi the number should be just next higher element or any higher element
like
if my arr is like
arr= 2 5 1 3 7 6
the next higher element for 5
should be what (7 or 6 ) because 6 is more closer to 7 but 7 comes first
in arr
On Wed, Jun 23, 2010 at 11:18 AM, Raj N rajn...@gmail.com wrote:
Given a list of numbers , How to find the max(x[i] XOR x[j]) in the
list.
Any solution less than O(n^2)?
--
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
Why not just change the definition of when one number is bigger than another
and do normal sort ?
I guess that is better and simpler.
Normal sort takes O(n log n), while Anurag's algo is O(n).
Regards,
Jagadish
http://www.cse.iitb.ac.in/~jagadish
On Jun 20, 2:18 pm, Rohit Saraf
Given a set of 1 Trillion integers on hard disk, find the smallest 1
million of them. You can fit at most 1 million integers in memory at a
time. State the fastest solution you can think of.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
There are N points on a LINE. U neeed to place a post office such that
its total distance from each of the N points is minimised.
The post office need not necessarily be on one of the N Points.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
if we dont want to change original list..
is there ny efficient method for that?
On 23 June 2010 06:49, ANUJ KUMAR kumar.anuj...@gmail.com wrote:
reverse one of the linked lists in O(n) time and then see if the
resulting one is same as the other one
On Wed, Jun 23, 2010 at 1:56 AM, divya
Find the next number for a given number without using any arithmetic
operators(use bit operations)
--
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
this is same as finding palindrome in a given linked list..
it may help
http://geeksforgeeks.org/?p=1072
On Wed, Jun 23, 2010 at 6:00 PM, divya jain sweetdivya@gmail.comwrote:
if we dont want to change original list..
is there ny efficient method for that?
On 23 June 2010 06:49, ANUJ
@Dave I tried your logic on 15 it got converted to 10, 4, 4,4. But still
could not understand the logic could you please explain?
On Tue, Jun 22, 2010 at 9:34 PM, Dave dave_and_da...@juno.com wrote:
Did you actually try the code by hand on a number to see what it does?
If you do, you will
No, Jagadish. You missed the statement Now use any inplace sorting
algorithm in Anurag's posting, which makes his algorithm also O(n log
n), and both Anurag and you missed the statement should not do any
pre or post processing.
Dave
On Jun 23, 8:52 am, Jagadish M jagadis...@gmail.com wrote:
Why
In step 3, if n m, then n can be written in the form i * 2^k + j,
where i 0 and 0 = j = m. Then, step 3 replaces n by i + j. Note
that
(i * 2^k + j) - (i + j) = i * (2^k - 1) = i * m.
Therefore, the step replaces any number greater than m by a small
number that differs from it by a multiple of
19 matches
Mail list logo