Click here to Skip to main content
15,886,919 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: question about divide and conquer algorithm Pin
Tim Craig14-Dec-09 22:40
Tim Craig14-Dec-09 22:40 
GeneralRe: question about divide and conquer algorithm Pin
<<Tash18>>14-Dec-09 23:05
<<Tash18>>14-Dec-09 23:05 
GeneralRe: question about divide and conquer algorithm Pin
Tim Craig15-Dec-09 9:43
Tim Craig15-Dec-09 9:43 
GeneralRe: question about divide and conquer algorithm Pin
<<Tash18>>17-Dec-09 1:12
<<Tash18>>17-Dec-09 1:12 
GeneralRe: question about divide and conquer algorithm Pin
Tim Craig17-Dec-09 9:43
Tim Craig17-Dec-09 9:43 
Questioncombinatorics: numbers with successive ones Pin
YaroslavPugach30-Oct-09 22:27
YaroslavPugach30-Oct-09 22:27 
Questionsearching and order of aalgorithm [modified] Pin
khomeyni29-Oct-09 2:48
khomeyni29-Oct-09 2:48 
AnswerRe: searching and order of aalgorithm Pin
Alan Balkany29-Oct-09 7:24
Alan Balkany29-Oct-09 7:24 
1. Sort the array in ascending order. (This is O(n lg(n)).
2. Use two integer indexes, i & j, that point to the array elements to add. The first one (i) starts at 0 (the index of the lowest number).
3. Do a binary search in the array to find the array element that is closest to x when added to the element at index 0 (j). If array [i] + array [j] == x, we're done.
4. Loop: Advance i to the next element.
5. While array [i] + array [j] > x, decrease j. If array [i] + array [j] == x, we're done.
6. When array [i] + array [j] < x, go to Step 4. When i >= j, there's no solution and we're done.
GeneralRe: searching and order of aalgorithm Pin
Member 419459329-Oct-09 10:06
Member 419459329-Oct-09 10:06 
GeneralRe: searching and order of aalgorithm Pin
Ian Shlasko29-Oct-09 11:12
Ian Shlasko29-Oct-09 11:12 
GeneralRe: searching and order of aalgorithm Pin
Luc Pattyn29-Oct-09 11:26
sitebuilderLuc Pattyn29-Oct-09 11:26 
GeneralRe: searching and order of aalgorithm Pin
Ian Shlasko29-Oct-09 11:33
Ian Shlasko29-Oct-09 11:33 
GeneralRe: searching and order of aalgorithm Pin
Member 419459329-Oct-09 12:51
Member 419459329-Oct-09 12:51 
GeneralRe: searching and order of aalgorithm Pin
Ian Shlasko29-Oct-09 13:01
Ian Shlasko29-Oct-09 13:01 
GeneralRe: searching and order of aalgorithm Pin
Member 419459329-Oct-09 13:13
Member 419459329-Oct-09 13:13 
GeneralRe: searching and order of aalgorithm Pin
Ian Shlasko29-Oct-09 13:31
Ian Shlasko29-Oct-09 13:31 
GeneralRe: searching and order of aalgorithm Pin
Alan Balkany29-Oct-09 16:29
Alan Balkany29-Oct-09 16:29 
GeneralRe: searching and order of aalgorithm Pin
Luc Pattyn29-Oct-09 13:17
sitebuilderLuc Pattyn29-Oct-09 13:17 
GeneralRe: searching and order of aalgorithm [modified] Pin
khomeyni29-Oct-09 21:34
khomeyni29-Oct-09 21:34 
QuestionShortest path related Pin
Alivemau526-Oct-09 4:02
Alivemau526-Oct-09 4:02 
AnswerRe: Shortest path related Pin
Alan Balkany26-Oct-09 4:37
Alan Balkany26-Oct-09 4:37 
GeneralRe: Shortest path related Pin
Alivemau526-Oct-09 5:20
Alivemau526-Oct-09 5:20 
GeneralRe: Shortest path related Pin
Alan Balkany26-Oct-09 5:36
Alan Balkany26-Oct-09 5:36 
GeneralRe: Shortest path related Pin
Alivemau526-Oct-09 7:22
Alivemau526-Oct-09 7:22 
GeneralRe: Shortest path related Pin
Alan Balkany26-Oct-09 8:20
Alan Balkany26-Oct-09 8:20 

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.