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]&g
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
>
> void main()
> {
>
> int a[10][4]=
> {{ 16,17,19,13},
> {18,14,1
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 big
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
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 g
@ 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".
--~--
@ 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".
--~--
Infinite Array ?
Infinite Array in sorted order ?
Let's say we have an infinite array where each of the elements have a
number (according to which it is sorted) and a valid/invalid bit for
storing the validity.
s - number we are searching for
arr[] - the infinite array
inc = 100;// this is
This is a Subset-Summation problem which is proven to be NP-Complete.
So there are no ways that you can devise a clever algo to solve it
accurately.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks"
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
{
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
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
"Algor
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 );
We will be calling the function like :
height = getheight(root);
and here's the function defination :
int getheight ( node *p )
{
if ( p==NULL )
return 0;
else
rh = getheight ( p->right );
lh = getheight ( p->left );
return ( (lh>rh ? lh : rh)+1 );
}
--~-
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 me
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 fr
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
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 m
Yeah the average case is O(n) and worst case is O(n^2) as rightfully
pointed out. But I still feel that this would be the best solution as
the P(worst case) is quite less.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
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 indicate
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]
F
Anybody got solutions for the Bitwise 2007 problems?
I'm particularly stuck with 2, 3, 4 (2nd part). I have solved 1, 5, 6,
7.
Here's the link to my solutions and the complete problem set :
http://naygib.blogspot.com/2007/02/bitwise-2007.html
Here's the link to the original site of Bitwise 2007
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 lik
To get the factorial exactly, you'd surely have to multiply and find
out.
But no.s like 321! are too big to be used with all the digits. So you
can use one of the many very good approximation methods to find it out.
--~--~-~--~~~---~--~~
You received this message
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 Groups
It is rather easy of you want an n(log n) algo.
But linear I don't thaink so.
--~--~-~--~~~---~--~~
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
you are wrong. It is of O(n^2) sine there is a k outer loop and an i
inner loop.
--~--~-~--~~~---~--~~
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.c
That link was gr8. Thanks for pointing it out.
--~--~-~--~~~---~--~~
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,
Graph Theory
by, N. Deo
It is a nice book covering almost the entire subject from ground up.
And yes, you don't have to be a CS Major to read this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks"
I am also searching it for a while. Please if anybody could post a link
--~--~-~--~~~---~--~~
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 uns
Why the hell are you posting your damn silly assignment problems in
this group.
I could solve them in Std IX. If you cannot solve it you ought to be
ashamed of yourself.
This is not a school assignment forum.
--~--~-~--~~~---~--~~
You received this message becau
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 ea
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 emai
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 help
Stop SPAMMING this group. One look at your profile tells us that you
are a SPAMMER with nothing better to do.
DO NOT DO THIS AGAIN.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post t
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 hav
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 ??
--~-
39 matches
Mail list logo