Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 753 results for
selectionsort
- Page 1
Re: need help with this code
Programming
Software Development
15 Years Ago
by ddanbe
Selectionsort
looks more like a bubblesort to me. The swap? in your if-statement should be in braces{} I would declare my variables out of the for-loop. What is temp doing?
Re: SelectionSort
Programming
Software Development
15 Years Ago
by Dewey1040
… [code=C] #include <stdio.h> void
SelectionSort
( int A[], int n ); int main(int argc, char…&A[i]) == 1; ++i) size = i - 2;
SelectionSort
( A, size ); printf("\nFirst five numbers:\n"); for…d", A[i]); fclose(fin); return 0; } void
SelectionSort
( int A[], int n ){ int i, j, min_index, temp…
Re: SelectionSort
Programming
Software Development
15 Years Ago
by Dewey1040
… code. [code=C] #include <stdio.h> void
SelectionSort
( int A[], int n ); int main(int argc, char *…(fin, "%d", &A[j]) == 1; j++)
SelectionSort
( A, j + 1 ); printf("\nFirst five numbers:\n"…;%d, ", A[i]); fclose(fin); return 0; } void
SelectionSort
( int A[], int n ){ int i, j, min_index, temp; …
SelectionSort
Programming
Software Development
15 Years Ago
by Dewey1040
I understand the algorithm
SelectionSort
, but once again my problem is the easy part( i …? I thought i did it right but when i run
selectionsort
it prints out from A[0] to A[100000] when…
Filling an array from Class and sort the array by selectionsort
Programming
Software Development
16 Years Ago
by Tinemelk
…, and then sort the elements by using the
selectionsort
algoritm. Im guessing I have to replace my filling… like Cars<int>Cars[10]? [CODE]void
selectionSort
(int *tab, int antall){ int indexLargestSoFar; int temp;…cout<<"Sorterer tabellen....." <<endl;
selectionSort
(tab,tab_length); for(int i = 0; i < 10…
Help with Selection Sort for vectors and arrays
Programming
Software Development
10 Years Ago
by asundar
…vector <int>&>(smallVector,smallVector.size());
SelectionSort
sort; sort.sortDataIter(smallArray,smallSize); cout << …{ min = j; } } swap(theList[i],theList[min]); } } void
SelectionSort
:: sortDataIter (vector<int>& theList, int sizeOfList) { int…
Re: Problem converting Selection Sort to Class
Programming
Software Development
17 Years Ago
by Bench
… a constructor which accepts a range of values - eg, [INLINECODE]
Selectionsort
::
Selectionsort
(int* begin, int* end) [/INLINECODE] or one which accepts an… array, eg, [INLINECODE]
Selectionsort
::
Selectionsort
(int arr[]) [/INLINECODE] Whichever of these you use, I don…
Problem converting Selection Sort to Class
Programming
Software Development
17 Years Ago
by Lomas
…include <iostream> using namespace std; class
Selectionsort
{ private: int i, j; int numbers[]; int…public: void sort(int[], int); void print(); }; void
Selectionsort
::sort(int numbers[], int array_size) { for (i =…
{Urgent} need help with file compression and decompression
Programming
Software Development
16 Years Ago
by j2swift
…++count_array[charPosition][nextPosition]; ++sort_array[charPosition][nextPosition]; }
selectionSort
(sort_array, indexSize); //**TEST for(int x=0;… ++count_array[charPosition][nextPosition]; ++sort_array[charPosition][nextPosition]; }
selectionSort
(sort_array, indexSize); //Display frequency //option to display …
Re: C++ newbie Need help^_^
Programming
Software Development
14 Years Ago
by Lerner
… fileName that's been sent to
selectionSort
that is being used fileName1 in
selectionSort
until you overwrite it on line… 114. Since you are using an ofstream in
selectionSort
and fileName1 is the string declared to hold the …to, I suspect you really want to send fileName1 to
selectionSort
, not fileName, anyway, which would be another good …
How many loops
Programming
Software Development
16 Years Ago
by helixkod
… while (swap); count++; return count; } //********************************************************************* //
selectionSort
takes in the array numbers and sorts the numbers from…to sort the numbers. * //********************************************************************* int
selectionSort
(int array[], int size) { int…
add selection sort as function in code
Programming
Software Development
14 Years Ago
by NitaB
…<< endl; } } //**************************************************************************** void
selectionSort
(size_t allCount[],size_t Size) { for (int …<< endl; } } //**************************************************************************** void
selectionSort
(size_t allCount[],size_t Size) { for (int …
[HELP] Converting my java code to GUI code
Programming
Software Development
11 Years Ago
by gm.rupert
….print("The Sorted numbers: "); access.
SelectionSort
(x); } } //
selectionSort
class public class
SelectionSort
{ public void
SelectionSort
(int[] arr){ for(int i=0; i…
Re: Help with Selection Sort for vectors and arrays
Programming
Software Development
10 Years Ago
by tinstaafl
Your algorithms seem to be ok, the problem appears to be in the swap. You're only swapping the values not the elements of the collection itself. See if this helps: void
SelectionSort
:: swap(int& one, int& two) { int temp = one; one = two; two = temp; }
Question Reading from a file and inputting into a string array I am getting a errors.
Programming
Software Development
15 Years Ago
by dpfaff
…inlab.dat, array, MAXSIZE); print (array, MAXSIZE); printNewLines(3);
selectionSort
(array, MAXSIZE); print (array, MAXSIZE); inlab.dat.close(); return… 0; } void
selectionSort
(String array[], int size) { int start, minIndex, minValue; for…
Help with minor corrections for selection sort and binary search
Programming
Software Development
14 Years Ago
by trace63b
…Student Names - Unsorted", JOptionPane.PLAIN_MESSAGE); //Call for
selectionSort
method
selectionSort
(studentNames, NO_OF_STUDENTS); //Display dialog box with sorted array …could not figure out how to correct public static void
selectionSort
(String studentNames[],int NO_OF_STUDENTS) { int index; int …
C++ newbie Need help^_^
Programming
Software Development
14 Years Ago
by 07tr0wa07
… prototype int binarySearch(long aray[], int, int); //function prototype void
selectionSort
(ofstream & , char[] , long aray[], int); //Fuction prototype void showarray… >> singleary; } //display the sorted numbers to the outfile
selectionSort
(outfile, fileName, aray,loop); //display unsorted array showarray(aray, loop…
Help with Average Class: arrays
Programming
Software Development
14 Years Ago
by bustersox
…quot;); data[index] = keyboard.nextInt(); // Call the
selectionSort
method.
selectionSort
(); // Call the calculateMean method. calculateMean(); } } /**…data The array to sort. */ public void
selectionSort
() { int startScan, index, minIndex, minValue;…
program help
Programming
Software Development
12 Years Ago
by broodwich
…, 6545231, 3852085, 7576651, 7881200, 4581002 }; int accountNumber;
selectionSort
(accounts, SIZE); cout << "\nPlease enter a…." << endl; return 0; } void
selectionSort
(int array[], int size) { int startScan, minIndex, minValue…
Radix sort
Programming
Software Development
11 Years Ago
by aaal
… = "BubbleSort"; break; case 'S': f = &
selectionSort
; algstr = "
SelectionSort
"; break; //case 'Q': f = &quickSort; algstr =… = "BubbleSort"; break; case 'S': f = &
selectionSort
; algstr = "
SelectionSort
"; break; //case 'I': f = &insertionSort; algstr =…
Re: Question Reading from a file and inputting into a string array I am getting a errors.
Programming
Software Development
15 Years Ago
by dpfaff
…inlab.dat, array, MAXSIZE); print (array, MAXSIZE); printNewLines(3);
selectionSort
(array, MAXSIZE); print (array, MAXSIZE); inlab.dat.close(); return… 0; } void
selectionSort
(string array[], int size) { int start, minIndex, minValue; for…
Re: [HELP] Converting my java code to GUI code
Programming
Software Development
11 Years Ago
by gm.rupert
…; i++) { x[i] = input.nextInt(); }
SelectionSort
access = new
SelectionSort
(); System.out.print("The Sorted numbers: "); access….
SelectionSort
(x); } } please help me again sir..…
Re: Problem converting Selection Sort to Class
Programming
Software Development
17 Years Ago
by Bench
… create a member function to work it out [CODE]int
Selectionsort
::size() { return ( sizeof(number)/sizeof(int) ); } [/CODE…
selection sorting issues
Programming
Software Development
17 Years Ago
by rQQt
…double data [20000]; int dataCnt; readFileIntoFloatArray(inputFilename,data,&dataCnt);
selectionSort
(data,dataCnt); int j; printf("\n\n OUTPUT after…dataArray[i]); i++; cnt++; } fclose(fp); *dataCnt=cnt; } void
selectionSort
(double *data, int count) { int i, j, min, temp; …
okay, why is this not working??????
Programming
Software Development
16 Years Ago
by rogenie
… "Holland, Beth", }; int result; char nameString[SIZE];
selectionSort
( names, NUM_NAMES ); cout << "Enter name: "…) cout << array[index] << endl; }*/ //
selectionSort
function void
selectionSort
( char array[][SIZE], int size ) { int startScan, minIndex; char…
Re: okay, why is this not working??????
Programming
Software Development
16 Years Ago
by rogenie
…;, "Holland, Beth", }; int result; char nameString[SIZE];
selectionSort
( names, NUM_NAMES ); cout << "Enter name: "… ) cout << array[index] << endl; } //
selectionSort
function void
selectionSort
( char array[][SIZE], int size ) { int startScan, minIndex; char…
How do I make the program to run.
Programming
Software Development
15 Years Ago
by dpfaff
…]; enter (inlab.dat, array, MAXSIZE); print (array, MAXSIZE); printNewLines(3);
selectionSort
(array, MAXSIZE); print (array, MAXSIZE); inlab.dat.close(); return 0…; } void
selectionSort
(string array[], int size) { int start, minIndex, minValue; for (start…
Creating 2 dimentional graphs
Programming
Software Development
14 Years Ago
by DarkoX
…t2=clock(); av1+=double(t2-t1); clock_t t3=clock();
SelectionSort
(b2,n2); clock_t t4=clock(); av2+=double(t4-t3);… clock_t t5=clock();
SelectionSort
(b3,n3); clock_t t6=clock(); av3+=double(t6-t5); …
why isn't the program running
Programming
Software Development
14 Years Ago
by rookanga
…} while (swap); // Same as while (swaps == true); return exchanges; } int
selectionSort
(long array[], int size) { int startScan, // Array indexes to be… compared minIndex, exchanges = 0; long minValue; void
selectionSort
(int array[], int size); for (startScan = 0; startScan &…
Help about Menu Dev C ++
Programming
Software Development
14 Years Ago
by kenetpascua
…endl; system("PAUSE"); return 0; }// end main() void
selectionSort
(int arr[], int size) { int indexOfMin, pass, j; for …indexOfMin]) indexOfMin = j; swap(arr[pass], arr[indexOfMin]); } }// end
selectionSort
() void swap(int& x, int& y) { int temp…
1
2
3
13
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC