Hi there, I'm fresh in learning c++ and I have to solve an exercise
with hanoi and my problem is that I'm running out of time!
The exercise is this, and I have to complete the ???
#include
#define DISK_NUMBER 4
// There are 3 towers represents 3 stacks
// The names of the disks are represented
If we have a temporary variable then the O(n) solution works. On 5/19/06, Karthik Singaram L <[EMAIL PROTECTED]
> wrote:Wont this algo have complexity O(n lgn) whereas a simple linear search would have O(n) and it would suffice for the problem
-- Manu Jose,mob :09844467453E-mail : [EMAIL PROTECT
Wont this algo have complexity O(n lgn) whereas a simple linear search would have O(n) and it would suffice for the problem
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this grou
Quick sort technique. Element to search k.
Sort(A, s,e, Key)
{
pivot=A[s];
z= partition(A,s,e,pivot); //this
will split the array in to two parts in which one part contains
elemnents lesser than the pivot and
other greater than pivot. If (
If I understand the problem right, how about going over all the
elements of the array and store the largest number less that given
number in a temp variable? - o(n)
If we can preprocess the i/p - either sort, or store in a BST -
(excluding the preprocessing time), we can reach to the solution in
o
Hi,
If i have an array like {1,4, 10, 15 , 20 , 30 } of size n , now if i
want to search for number
25 , i should get 20 , if i search for number 11 i hould get 10 , if i
search for 4 i should get 4, if i search for a number and it doesn't
exist i should get the lower number between which it li
Hi a,,,
I want the code for KD Trees
If possible with pattern classification also.
Thank you.-- Praneeth M Shishtlahttp://students.iiit.ac.in/~praneethms/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Algorithm Geek