On Jun 5, 1:45 am, Feng [EMAIL PROTECTED] wrote:
Hi BiGYaN, triangle is a 2D object which can be formed by any 3 non-
collinear points. It can exist in 4D, just like a point existing in
3D.
On May 31, 2:11 am, Victor Carvalho [EMAIL PROTECTED] wrote:
Feng, how can form a triangle
Just test whether they are collinear or not i.e. get the slopes,
m1 from 1st and 2nd point
m2 from 2nd and 3rd point
if m1==m2 then they do not form a triangle
else they do
Computing the area of the triangle and testing for 0 might also
work but I feel that the computation will be
On May 28, 6:21 pm, sl7fat [EMAIL PROTECTED] wrote:
hi i have an algorthim code and i have to find the time complixcity of
the code so can you plz help me ASAP the code is written done ,,
# include iostream.h
void main()
{
int a[10][4]=
{{ 16,17,19,13},
As far as I get it, this may be the solution :
Find out all the possible lines between those n points (total of nC2
lines). Here we define a line to be an ordered set of 2 points where
the first point is 2nd point (ie. length of origin to first point is
length of origin from 2nd point). Then
@ Arun
By, arr[i].val I meant the value stored in i-th position and not the
valid/invalid bit. So I'm not making any assumption related to storing
of valid numbers in contiguous positions.
Guess I should have written arr[i].value as val is common to both
value as well as valid.
You just want a solution or you want a DPP solution?
A O(n^4) solution is trivial in nature and is quite easily achievable.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
The thing that you asked for is formally known as BFT (Breadth First
Traversal). Here's the pseudo-code that'll give you the idea in
general.
#define MAX 100
void BFT ( node *root )
{
node *p;
ins_Q(root);// inserting the node into a queue
do
{
Yup dudes I agree it was a wrong program I have put the
proper indentation without proper braces and that makes the code
incorrect.
The correct program would be :
int getheight ( node *p )
{
if ( p==NULL )
return 0;
else
{
rh = getheight ( p-right );
I would also like to visit such a site. Its been quite frustrating
trying out problems for hours only to find out that nowhere can you
get the correct solution.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
There is no perfect hash function that will give an unique location
every time it is called. So BTrees will be faster no doubt.
Also note that with BTrees (or B+Trees) it is easier to retrieve data
filtered on range(s) of keys.
--~--~-~--~~~---~--~~
You received
RR* = R* only when R contains a null string.
else, RR* = R+
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe
This looks like the classic Assignment problem to me do look up
on this topic and I'm sure you'll come across a few good algos.
Initially, it seems that it'll be an O(n^3) problem but maybe you
can better it !!
--~--~-~--~~~---~--~~
You received this
Yeah, after finding the k-th element there is no need for further
partitioning. This is logically true indeed.
But in this case, I guess you have to do it for determining who'll get
the Samosas and who the Gulabjamuns !!.
--~--~-~--~~~---~--~~
You received this
Please don't post homework questions here. This problem is too simple
for a group calling themselves Algorithm Geeks.
I hope most of you'll agree to this and put a stop to this practice.
--~--~-~--~~~---~--~~
You received this message because you are subscribed
You could try :
The C++ Programming Language (3rd or Special Ed)
by, Bjarne Stroustrup
This is the fellow who developed the C++ language and this is really
an awesome book. However if you are a newbie to programming then you
might find certain difficulties with it.
You could try the quick-sort algo with these further modifications :
every time you partition the list (assuming ascending) you leave out
the entire working for the right hand part iff the size of the left
hand part is = m (m is the top m elements that you need). NB : Here
left hand part
ThankZ a lot
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
Trying to write an OS at 12 !! GR8.
But unfortunately writing an OS is very difficult. I have written only
a basic OS like DOS. It took me around a month and I am a Computer
Science final year student.
So dump the idea of writing an OS atleast for now. Better write
some utility programs
Deepu, are you sure that this Algo will have an O(n) complexity. None
of my friends and for that matter most of my teachers disagree with it
having a linear time bound.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Assuming that you cannot have any letter repeated more than 15 times.
Create a struct of 26, 4 bit bitfields. This is going to take 26x4 bits
or 13 bytes of memory.
Use this structure to store the character count of each character of
the first string.
Now proceed to the second string and for
It is simple. Here are the steps,
tot = sum of the entire array
max = tot
start = 0
end = n-1
sub_start = start
sub_end = end
while ( start end )
{ if ( array[start] array[end] )
{ tot=tot-array[start]
start++
}
else
{ tot=tot-array[start]
end--
}
if ( tot = max )
Hey Admin,
Please ban this fellow.
He's just using the group for his own well being and spamming the group
!!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email
With regards to the first problem, it is pretty easy if you can have
all the primes precomputed. As a matter of fact, if you search the net,
you'll find the list of all prime no.s that can be stored as a 4 byte
unsigned integer !!. Just use that list of primes to find out the
nearest with the
If we can have the total no. of nodes in tree as an input (say N), this
problem is pretty easy.
We construct a full BST of level = ceiling ( log (base 2) N ) - 1
conatining only dummy nodes. Now we travel the BST in the same fashion
as a linked list starting from the root node. The root must
Was that a test-your-knowledge question ? or are u really interested ?
If latter then look up Knuth. If u are looking for a solution in a
particular domain, this can be solved far easily. Please mention the
data structure used for storing the number and the result and upto what
accuracy ??
25 matches
Mail list logo