15,958,827 members
Home / Discussions / Algorithms

# Algorithms

 Triangulation inside a contour Member 1505866510-Mar-22 1:44 Member 15058665 10-Mar-22 1:44
 Re: Triangulation inside a contour Gerry Schmitz10-Mar-22 16:27 Gerry Schmitz 10-Mar-22 16:27
 Re: Triangulation inside a contour Member 1505866510-Mar-22 20:43 Member 15058665 10-Mar-22 20:43
 Re: Triangulation inside a contour Gerry Schmitz11-Mar-22 4:05 Gerry Schmitz 11-Mar-22 4:05
 Re: Triangulation inside a contour Member 1505866511-Mar-22 19:56 Member 15058665 11-Mar-22 19:56
 concern to shaker sort arlgorithm Member 1523340925-Jan-22 3:38 Member 15233409 25-Jan-22 3:38
 `I am currently taking a exercise is the shaker sort algorithm.Instead of separating two for loops, I have included a for-j loop inside a for-i loop. Please check my code.` ```public static void shakerSort(int array[], int n) { boolean swapped = true; while (swapped) { swapped = false; for (int i = 0; i < n - 1; i++) { if (array[i] > array[i + 1]) { int temp = array[i]; array[i] = array[i + 1]; array[i + 1] = temp; swapped = true; } if (i == n - 2) { if (!swappped) { break; } else { swapped = false; for (int j = n - 1; j > 0; j--) { if (array[j - 1] > array[j]) { int temp = array[j]; array[j] = array[j - 1]; array[j - 1] = temp; swapped = true; } } if (!swapped) { break; } } } } }``` ```Output: -5 -3 5 9 11 12 15 18 ``` `I hope you can rate my code .Thank you very much `
 Re: concern to shaker sort arlgorithm Richard Andrew x6410-Feb-22 9:27 Richard Andrew x64 10-Feb-22 9:27
 Verification Algorithm that mortals can use to verify chain of discussion making. XxKeldecknightxX7-Jan-22 1:45 XxKeldecknightxX 7-Jan-22 1:45
 Re: Verification Algorithm that mortals can use to verify chain of discussion making. Eddy Vluggen9-Feb-22 1:56 Eddy Vluggen 9-Feb-22 1:56
 Re: Verification Algorithm that mortals can use to verify chain of discussion making. Eddy Vluggen9-Feb-22 12:06 Eddy Vluggen 9-Feb-22 12:06
 Wildcard Matching Routine Richard Andrew x6424-Dec-21 9:17 Richard Andrew x64 24-Dec-21 9:17
 Re: Wildcard Matching Routine Gerry Schmitz25-Dec-21 5:24 Gerry Schmitz 25-Dec-21 5:24
 Re: Wildcard Matching Routine Richard Andrew x6425-Dec-21 6:09 Richard Andrew x64 25-Dec-21 6:09
 Re: Wildcard Matching Routine Gerry Schmitz25-Dec-21 8:25 Gerry Schmitz 25-Dec-21 8:25
 Re: Wildcard Matching Routine k505425-Dec-21 7:16 k5054 25-Dec-21 7:16
 Re: Wildcard Matching Routine Richard Andrew x6426-Dec-21 1:32 Richard Andrew x64 26-Dec-21 1:32
 Re: Wildcard Matching Routine englebart8-Feb-22 16:36 englebart 8-Feb-22 16:36
 Re: Wildcard Matching Routine trønderen9-Feb-22 6:35 trønderen 9-Feb-22 6:35
 Re: Wildcard Matching Routine englebart9-Feb-22 15:37 englebart 9-Feb-22 15:37
 Re: Wildcard Matching Routine Eddy Vluggen9-Feb-22 16:10 Eddy Vluggen 9-Feb-22 16:10
 Re: Wildcard Matching Routine trønderen10-Feb-22 6:03 trønderen 10-Feb-22 6:03
 Re: Wildcard Matching Routine englebart10-Feb-22 9:14 englebart 10-Feb-22 9:14
 Time Complexity of following method? Member 1269110623-Nov-21 4:09 Member 12691106 23-Nov-21 4:09
 Last Visit: 31-Dec-99 18:00     Last Update: 5-Aug-24 2:42 Refresh ᐊ Prev1...567891011121314 Next ᐅ