Click here to Skip to main content
15,899,126 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: pumping lema and regular languages Pin
Alan Balkany11-May-09 3:35
Alan Balkany11-May-09 3:35 
QuestionAlgorithm to sort list Pin
TheConfusedGuy7-May-09 11:27
TheConfusedGuy7-May-09 11:27 
AnswerRe: Algorithm to sort list Pin
harold aptroot7-May-09 12:24
harold aptroot7-May-09 12:24 
AnswerRe: Algorithm to sort list Pin
Luc Pattyn7-May-09 12:56
sitebuilderLuc Pattyn7-May-09 12:56 
AnswerRe: Algorithm to sort list Pin
Luc Pattyn7-May-09 13:55
sitebuilderLuc Pattyn7-May-09 13:55 
AnswerRe: Algorithm to sort list [modified] Pin
dybs7-May-09 17:55
dybs7-May-09 17:55 
GeneralRe: Algorithm to sort list (Reply to All) Pin
TheConfusedGuy7-May-09 18:27
TheConfusedGuy7-May-09 18:27 
GeneralRe: Algorithm to sort list (Reply to All) Pin
dybs7-May-09 19:01
dybs7-May-09 19:01 
TheConfusedGuy wrote:

1. Subdivision length is 50 miles (say default speed = 50 MPH
2. Zone speed 1 exists from mile 0 to mile 28 at 40 MPH
3. Zone speed 2 exists from mile 28 to mile 31 at 20 MPH
4. Zone speed 3 exists from 31 to mile 50 at 25 MPH
5. TSO A exists from mile 25 to 29 at 15 MPH
6. TSA B exists from mile 30 to mile 34 at 10 MPH

1. Mile 0 to 25 @ 40 MPH
2. Mile 25 to 29 @ 15 MPH
3. Mile 29 to 30 @ 20 MPH
4. Mile 30 to 34 @ 10 MPH
5. Mile 34 to 50 @ 25 MPH


Here's a question: what would the speed be for mile 25? 40 or 15? Or are you getting speeds for ranges only?

I hadn't thought about overlapping TSO's, such as 6 above. Such TSOs may need to have a parent node in the tree for each subsection they overlap, as below.

I think the insertion method I described above would still work, where the overlapping TSO would be a child of the subsection starting at 0. The list you described above would have a tree as follows:

          0,50,50
       /     |    \
0,28,40  28,31,20  31,50,25
  \      /    \     /
  25,29,15    30,34,10


Can't think of a good way to split up all the zones using the tree either, to get the speeds for a given range (say miles 26 to 33). Plus, having multiple parent nodes certainly complicates the insertion process, so a linked list like Luc's method is probably better.

Dybs
GeneralRe: Algorithm to sort list (Reply to All) Pin
TheConfusedGuy7-May-09 19:07
TheConfusedGuy7-May-09 19:07 
Questionbearing angle calculation Pin
ranjanguru6-May-09 22:45
ranjanguru6-May-09 22:45 
AnswerRe: bearing angle calculation Pin
molesworth6-May-09 23:38
molesworth6-May-09 23:38 
GeneralRe: bearing angle calculation Pin
ranjanguru6-May-09 23:48
ranjanguru6-May-09 23:48 
GeneralRe: bearing angle calculation Pin
molesworth7-May-09 0:06
molesworth7-May-09 0:06 
GeneralRe: bearing angle calculation Pin
molesworth8-May-09 3:13
molesworth8-May-09 3:13 
AnswerRe: bearing angle calculation Pin
OriginalGriff6-May-09 23:52
mveOriginalGriff6-May-09 23:52 
GeneralRe: bearing angle calculation Pin
ranjanguru6-May-09 23:57
ranjanguru6-May-09 23:57 
AnswerRe: bearing angle calculation Pin
Stuart Cox7-May-09 11:01
Stuart Cox7-May-09 11:01 
AnswerRe: bearing angle calculation Pin
cp98768-May-09 15:30
cp98768-May-09 15:30 
QuestionPolygon Rendering Performance Optimization Pin
StarBP6-May-09 11:27
StarBP6-May-09 11:27 
QuestionWhich language is this Urgent help required Pin
Sanjaykalsi5-May-09 22:55
Sanjaykalsi5-May-09 22:55 
AnswerRe: Which language is this Urgent help required Pin
OriginalGriff5-May-09 23:03
mveOriginalGriff5-May-09 23:03 
QuestionTrying to create a for loop that gives all Unique combinations without using recursive process. Pin
luke.orun5-May-09 13:49
luke.orun5-May-09 13:49 
AnswerRe: Trying to create a for loop that gives all Unique combinations without using recursive process. Pin
Luc Pattyn5-May-09 14:41
sitebuilderLuc Pattyn5-May-09 14:41 
GeneralRe: Trying to create a for loop that gives all Unique combinations without using recursive process. Pin
luke.orun5-May-09 22:09
luke.orun5-May-09 22:09 
GeneralRe: Trying to create a for loop that gives all Unique combinations without using recursive process. Pin
Luc Pattyn5-May-09 23:42
sitebuilderLuc Pattyn5-May-09 23:42 

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.