Click here to Skip to main content
15,885,216 members
Home / Discussions / Algorithms
   

Algorithms

 
Questionrecursive algorithm Pin
Member 1374335523-Mar-18 7:00
Member 1374335523-Mar-18 7:00 
AnswerRe: recursive algorithm Pin
Gerry Schmitz23-Mar-18 12:00
mveGerry Schmitz23-Mar-18 12:00 
AnswerRe: recursive algorithm Pin
Peter_in_278023-Mar-18 14:53
professionalPeter_in_278023-Mar-18 14:53 
QuestionSquare root of positive integer using binary search. Pin
lnikon25-Feb-18 9:40
lnikon25-Feb-18 9:40 
GeneralRe: Square root of positive integer using binary search. Pin
harold aptroot25-Feb-18 10:29
harold aptroot25-Feb-18 10:29 
GeneralRe: Square root of positive integer using binary search. Pin
lnikon25-Feb-18 10:54
lnikon25-Feb-18 10:54 
AnswerRe: Square root of positive integer using binary search. Pin
Richard Deeming26-Feb-18 1:21
mveRichard Deeming26-Feb-18 1:21 
AnswerRe: Square root of positive integer using binary search. Pin
Patrice T7-Apr-18 21:01
mvePatrice T7-Apr-18 21:01 
A square root function should have only 1 parameter and your recursive function with left and right should be for private use only.

The only way to have middle=0, is if x=0 from the beginning.
So if you check for x=0, you will not have to continuously check if middle=0 or not.

As far as I can see the only result your function can give is 0.
Patrice

“Everything should be made as simple as possible, but no simpler.” Albert Einstein

Question3D Points to 2D Points Pin
Member 1368222216-Feb-18 15:34
Member 1368222216-Feb-18 15:34 
AnswerRe: 3D Points to 2D Points Pin
Ralf Meier17-Feb-18 0:35
mveRalf Meier17-Feb-18 0:35 
GeneralRe: 3D Points to 2D Points Pin
jschell17-Feb-18 11:41
jschell17-Feb-18 11:41 
GeneralRe: 3D Points to 2D Points Pin
Ralf Meier17-Feb-18 23:02
mveRalf Meier17-Feb-18 23:02 
QuestionNode discovery in a truly decentralized system Pin
stopthespying15-Feb-18 6:40
stopthespying15-Feb-18 6:40 
AnswerRe: Node discovery in a truly decentralized system Pin
Gerry Schmitz16-Feb-18 5:21
mveGerry Schmitz16-Feb-18 5:21 
QuestionFinding strongly connected component in a directed Graph using PHP Pin
Member 136573131-Feb-18 21:22
Member 136573131-Feb-18 21:22 
QuestionA very interesting question for you all Pin
Member 1364484725-Jan-18 14:28
Member 1364484725-Jan-18 14:28 
AnswerRe: A very interesting question for you all Pin
Richard MacCutchan25-Jan-18 22:26
mveRichard MacCutchan25-Jan-18 22:26 
AnswerRe: A very interesting question for you all Pin
jschell8-Feb-18 13:33
jschell8-Feb-18 13:33 
AnswerRe: A very interesting question for you all Pin
Luc Pattyn8-Feb-18 14:59
sitebuilderLuc Pattyn8-Feb-18 14:59 
Questionpython code on Effect of order of accuracy on the numerical differentiation Pin
Member 1362564316-Jan-18 1:32
Member 1362564316-Jan-18 1:32 
GeneralRe: python code on Effect of order of accuracy on the numerical differentiation Pin
harold aptroot17-Jan-18 23:28
harold aptroot17-Jan-18 23:28 
QuestionCompare products in Cart against min/max limitations Pin
Rico6419-Dec-17 7:07
Rico6419-Dec-17 7:07 
AnswerRe: Compare products in Cart against min/max limitations Pin
Gerry Schmitz21-Dec-17 11:04
mveGerry Schmitz21-Dec-17 11:04 
GeneralRe: Compare products in Cart against min/max limitations Pin
Rico6422-Dec-17 0:42
Rico6422-Dec-17 0:42 
AnswerRe: Compare products in Cart against min/max limitations Pin
Richard MacCutchan21-Dec-17 21:40
mveRichard MacCutchan21-Dec-17 21:40 

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.