Click here to Skip to main content
15,889,808 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: What Does Complexity of Algorithm Mean??? Pin
harold aptroot26-May-16 1:35
harold aptroot26-May-16 1:35 
AnswerRe: What Does Complexity of Algorithm Mean??? Pin
Patrice T28-May-16 9:55
mvePatrice T28-May-16 9:55 
SuggestionRe: What Does Complexity of Algorithm Mean??? Pin
Richard Deeming1-Jun-16 1:24
mveRichard Deeming1-Jun-16 1:24 
GeneralRe: What Does Complexity of Algorithm Mean??? Pin
Patrice T1-Jun-16 1:45
mvePatrice T1-Jun-16 1:45 
QuestionHow they got this function? Pin
Member 125085107-May-16 1:51
Member 125085107-May-16 1:51 
AnswerRe: How they got this function? Pin
Chris Losinger12-May-16 6:33
professionalChris Losinger12-May-16 6:33 
QuestionIn Search for a Published Board Game Generating Algorithm Pin
Mark.io5-May-16 2:13
Mark.io5-May-16 2:13 
QuestionAlgorithm Pin
Member 1246448116-Apr-16 5:43
Member 1246448116-Apr-16 5:43 
Hi i have this Algorithm, could anyone help me figure out the answer to it, and how?


C#
Create a recurrence function to represent the following algorithm's time complexity and use the master method to analyse the following algorithm:

/* The function f(x) is unimodal over the range [min, max] and can be evaluated in Θ(1) time
 * ε > 0 is the precision of the algorithm, typically ε is very small
 * max > min
 * n = (max - min)/ε, n > 0, where n is the problem size */
Algorithm(max, min)
{
     if ((max - min) < ε)
     {
           return (max - min)/2   // return the answer
     }


     leftThird = (2 * min + max) / 3      // represents the point which is 1/3 of the way from min to max
     rightThird = (min + 2 * max) / 3   // represents the point which is 2/3 of the way from min to max

     if (f(leftThird) < f(rightThird))
     {
           return Algorithm(leftThird, max)   // look for the answer in the interval between leftThird and max
     }
     else
     {
           return Algorithm(min, rightThird)  // look for the answer in the interval between min and rightThird
     }
}

AnswerRe: Algorithm Pin
Richard Deeming18-Apr-16 2:28
mveRichard Deeming18-Apr-16 2:28 
GeneralRe: Algorithm Pin
honglomong940@gmail.com29-Apr-16 22:50
honglomong940@gmail.com29-Apr-16 22:50 
AnswerRe: Algorithm Pin
Patrice T18-Apr-16 5:46
mvePatrice T18-Apr-16 5:46 
QuestionDealing with arbitrarily large power of 10 numbers Pin
Member 1168325115-Apr-16 3:52
Member 1168325115-Apr-16 3:52 
SuggestionRe: Dealing with arbitrarily large power of 10 numbers Pin
Richard Deeming15-Apr-16 4:21
mveRichard Deeming15-Apr-16 4:21 
GeneralRe: Dealing with arbitrarily large power of 10 numbers Pin
Member 1168325115-Apr-16 8:45
Member 1168325115-Apr-16 8:45 
AnswerRe: Dealing with arbitrarily large power of 10 numbers Pin
Eddy Vluggen15-Apr-16 5:00
professionalEddy Vluggen15-Apr-16 5:00 
AnswerRe: Dealing with arbitrarily large power of 10 numbers Pin
Kenneth Haugland15-Apr-16 14:43
mvaKenneth Haugland15-Apr-16 14:43 
AnswerRe: Dealing with arbitrarily large power of 10 numbers Pin
Mark.io5-May-16 1:56
Mark.io5-May-16 1:56 
GeneralRe: Dealing with arbitrarily large power of 10 numbers Pin
Member 116832518-May-16 22:15
Member 116832518-May-16 22:15 
AnswerRe: Dealing with arbitrarily large power of 10 numbers Pin
Daniel Pfeffer8-May-16 22:36
professionalDaniel Pfeffer8-May-16 22:36 
Question~difficult~ finding combination from K arrays Pin
Member 1245958914-Apr-16 6:27
Member 1245958914-Apr-16 6:27 
GeneralRe: ~difficult~ finding combination from K arrays Pin
Richard MacCutchan14-Apr-16 20:43
mveRichard MacCutchan14-Apr-16 20:43 
QuestionCompression algorithms Pin
Member 121468278-Apr-16 9:38
Member 121468278-Apr-16 9:38 
AnswerRe: Compression algorithms Pin
Dave Kreskowiak8-Apr-16 10:37
mveDave Kreskowiak8-Apr-16 10:37 
GeneralRe: Compression algorithms Pin
Patrice T9-Apr-16 0:54
mvePatrice T9-Apr-16 0:54 
AnswerRe: Compression algorithms Pin
Patrice T9-Apr-16 0:54
mvePatrice T9-Apr-16 0:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.