Click here to Skip to main content
15,894,405 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: WANTED: Programmer looking for an algorithmic challenge Pin
Xpnctoc25-Jul-10 10:45
Xpnctoc25-Jul-10 10:45 
AnswerRe: WANTED: Programmer looking for an algorithmic challenge [modified] Pin
Luc Pattyn25-Jul-10 12:12
sitebuilderLuc Pattyn25-Jul-10 12:12 
AnswerRe: WANTED: Programmer looking for an algorithmic challenge Pin
Member 419459325-Jul-10 12:52
Member 419459325-Jul-10 12:52 
QuestionGet the angle in radians of a shape made up with 2D points? Pin
venomation20-Jul-10 9:01
venomation20-Jul-10 9:01 
AnswerRe: Get the angle in radians of a shape made up with 2D points? Pin
Alan Balkany21-Jul-10 3:53
Alan Balkany21-Jul-10 3:53 
GeneralRe: Get the angle in radians of a shape made up with 2D points? Pin
venomation21-Jul-10 7:30
venomation21-Jul-10 7:30 
Questiondetect recursion during compilation Pin
invader8215-Jul-10 22:46
invader8215-Jul-10 22:46 
AnswerRe: detect recursion during compilation Pin
Alan Balkany16-Jul-10 4:04
Alan Balkany16-Jul-10 4:04 
Define a static variable for the function you're trying to protect from recursion, and give it an initial value.

Then at the beginning of the function, test this variable and throw an exception if it DOESN'T have this initial value. If it does, set the variable to a different value, then reset it to the initial value just before you leave the function.

This detects recursion at run time. A few languages (like PL/I) require you to declare recursive functions as "recursive", but as far as I know, most languages won't allow you to detect and prevent recursion at compile time.
AnswerRe: detect recursion during compilation Pin
Peter_in_278016-Jul-10 14:41
professionalPeter_in_278016-Jul-10 14:41 
AnswerRe: detect recursion during compilation Pin
T M Gray23-Jul-10 6:27
T M Gray23-Jul-10 6:27 
AnswerRe: detect recursion during compilation [OpenCL] Pin
ProtoBytes25-Jul-10 8:50
ProtoBytes25-Jul-10 8:50 
QuestionDistributing (different sized) objects Pin
Wjousts15-Jul-10 4:30
Wjousts15-Jul-10 4:30 
AnswerRe: Distributing (different sized) objects Pin
Alan Balkany16-Jul-10 4:01
Alan Balkany16-Jul-10 4:01 
GeneralRe: Distributing (different sized) objects Pin
Wjousts16-Jul-10 4:29
Wjousts16-Jul-10 4:29 
GeneralRe: Distributing (different sized) objects Pin
Alan Balkany16-Jul-10 4:37
Alan Balkany16-Jul-10 4:37 
GeneralRe: Distributing (different sized) objects Pin
Wjousts16-Jul-10 5:40
Wjousts16-Jul-10 5:40 
GeneralRe: Distributing (different sized) objects Pin
Alan Balkany16-Jul-10 5:50
Alan Balkany16-Jul-10 5:50 
GeneralRe: Distributing (different sized) objects Pin
Wjousts20-Jul-10 3:31
Wjousts20-Jul-10 3:31 
GeneralRe: Distributing (different sized) objects Pin
Wjousts20-Jul-10 7:56
Wjousts20-Jul-10 7:56 
GeneralRe: Distributing (different sized) objects Pin
Alan Balkany20-Jul-10 8:01
Alan Balkany20-Jul-10 8:01 
AnswerRe: Distributing (different sized) objects Pin
Luc Pattyn16-Jul-10 5:54
sitebuilderLuc Pattyn16-Jul-10 5:54 
GeneralRe: Distributing (different sized) objects Pin
Alan Balkany16-Jul-10 6:06
Alan Balkany16-Jul-10 6:06 
GeneralRe: Distributing (different sized) objects Pin
Wjousts20-Jul-10 3:30
Wjousts20-Jul-10 3:30 
GeneralRe: Distributing (different sized) objects Pin
Luc Pattyn20-Jul-10 8:11
sitebuilderLuc Pattyn20-Jul-10 8:11 
GeneralRe: Distributing (different sized) objects Pin
Wjousts20-Jul-10 9:14
Wjousts20-Jul-10 9:14 

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.