Questions tagged [bubble-sort]

The tag has no usage guidance.

8 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
2answers
36 views

PSET3 Plurality trouble. All of the checks on check50 work except 1!

I am having trouble figuring out what is wrong with my code. The only failure in check50 is (:( print_winner identifies Charlie as winner of election Cause print_winner function did not print winner ...
0
votes
0answers
15 views

Bubble sort not working

Bublesort <p id= "notiz">Hello World!</p> <script> document.getElementById("notiz").innerHTML = "The results of Bubblesort:<br>"; var mannschaft = ["Leander", "...
0
votes
1answer
45 views

Help fixing bubble sort

I've been working on implementing a bubble sort, and I can get it to swap one time through the list, but I can't get it to run more than once, and I'm not sure how to implement it. I also know that ...
0
votes
1answer
42 views

Is this a correct way of implementing bubble sort?

I made a bubble sort code, but I want to make sure that my code is correct. My code is void sort(int values[], int n) { if (n == 1) { return 0; } int swapcount = 0; ...
0
votes
1answer
236 views

Bubble sort algorithm not working - PLEASE HELP!

I have created a separate file to test my bubble sort algorithm for pset 3. The file compiles but when I run it, it just prints out the elements in the array in their original order! Can someone ...
0
votes
1answer
110 views

Receiving an expected expression error on pset3 (curly braces match)

Tad bit confused as to why I'm receiving an expected expression error. I've looked at other questions for help on this, but the solution seems to be the curly braces. I've actually done this, and I'm ...
0
votes
1answer
534 views

pset3 implementing bubblesort, how should i test what is most likely garbage?

i am a total beginner and i tried to implement bubble sort as follows: void swap(int* a, int* b) { int temp = *a; *a = *b; *b = temp; } void sort(int values[], int n) { do int counter=0; ...
-1
votes
1answer
151 views

Because of calling recursive function don't do printf?

Because of calling recursive function don't do printf (bubble sort)? (actually only first time) #include <stdio.h> int* bubblesort(int n1, int arr[]) { for (int i = 0; i < n1 - ...