19 Topics

Member Avatar for
Member Avatar for nekoleon64

//Bubble.h #include <iostream> #include <fstream> #include <cstdlib> using namespace std; struct nodeType { int info; nodeType *link; }; class Bubble { public: Bubble(); //constructor //deconstructor //copy constructor //operator= (overloading the = operator) friend istream & operator>> (istream &infile, Bubble & mylist); friend ostream & operator<< (ostream &outfile, const Bubble & …

Member Avatar for VernonDozier
0
1K
Member Avatar for nekoleon64

My name is Leonard E. Norwood Jr. I'm just practicing a simple bubblesort program but this time using classes and pointers with operators >> and << and also an overloaded operator =. I'm merely trying to sort a list of numbers from lowest to highest. And the purpose of the …

Member Avatar for nekoleon64
0
243
Member Avatar for Dean_williams

Hello. I am having a tough time understanding the concept of double linked list. For now, i understand double linked list has 2 links, one forward and another one previous. data is in the middle. when inserting must check where to insert. if previous is equal to null, then can …

Member Avatar for Dean_williams
0
229
Member Avatar for dctb13

Hi, I'm trying to sort a list of names in c++ (first name and last name). I'm running into a couple of problems with my code. I'll post the code first then state my problems. #include <iostream> #include <stdio.h> #include <cstring> using namespace std; const int numNames=3;//this makes the code …

Member Avatar for BobS0327
0
7K
Member Avatar for TheWind147

Hello, I am in the process of creating a program that accepts random numbers, put them in an array and sort them using different types of sorting algorithms. I then passed the array as an argument to the "BubbleSort" function, however, when I try to call the array in the …

Member Avatar for TheWind147
0
185
Member Avatar for Programmer!!!

Hi! I'm writing a program in C++ where the user is asked to enter a list of ten names and cities of residence in the format <firstname> <Surname> <city>. I then have to sort the list by city and then in each city group alphabetically by name, using Bubblesort. I'm …

Member Avatar for Damian Dalton
0
194
Member Avatar for AdamLad3

Hi, I'm writing a program in C++ to ask the user for a list of ten names and cities of residence in the format <firstname> <Surname> <city>. The amount of spaces between each doesn't matter as I will be using isspace. then i have to sort the list by city …

Member Avatar for Damian Dalton
0
1K
Member Avatar for wallet123

i was watching a tutorial about bubblesort, and i followed all the instructions the difference is that the tutor is using System.out while im using JOPtionPane, please help me thank you help me find my error and help me run it correctly! [CODE]public static void main(String[] args) { // TODO …

Member Avatar for rushikesh jadha
0
179
Member Avatar for AlexTrott

Hello, I'm hoping you guys can help. I have a double linked list, and i am trying to add a bubble sort to it,I am really new to java, I've been able to do a bubble sort with great easy whilst using binary trees, but now i'm using a double …

Member Avatar for JamesCherrill
0
377
Member Avatar for lmytilin

[CODE] #include <iostream> #include <string> #include <cctype> #include <iomanip> #define N 36 using namespace std; string EraseWhiteSpaces(string &str_nospaces) { int i; for (int i=0;i<str_nospaces.length();i++) { if (str_nospaces[i]==' '||(str_nospaces[i]=='\t')) { str_nospaces.erase(i,1); i--; } } return str_nospaces; } string ConvertToLowerCase(string &str_lowercase) { int i; for (i=0;i<str_lowercase.length();i++) str_lowercase[i]=tolower(str_lowercase[i]); return str_lowercase; } void SortedFrequences(int …

Member Avatar for mikrosfoititis
0
174
Member Avatar for JohnQ002

I have to create a program in C and not C++, that allows the user to create a file that stores names and numbers, displays them and sorts the dates by names or numbers using Bubble sorting. I know how to create a program that sorts names and numbers that …

Member Avatar for JohnQ002
0
1K
Member Avatar for Vonga

hi I'm new I got some questions about bubble-sort, so I registered here. I'm currently working on this program (bubble-sort) so I looked up some example codes and I found this here, which is practically the right thing I'm looking for. But I have some questions, like 1. How would …

Member Avatar for Vonga
0
133
Member Avatar for JRDJ12

[CODE]package com.abc.text; public class StringProcessing { /** * Returns the number of non-null strings in the set. * If null or a zero-length array is passed in, then zero is returned. * If a slot in the array is null, then it is ignored (not counted). */ public static int …

Member Avatar for JRDJ12
0
464
Member Avatar for JRDJ12

Can someone show me what bubble-sorting an int[] of { 5, 4, 3, 2, 1 } looks like? I have to place it inside [CODE]public class SortIntArray { // this method needs your code to be added to work public static void sort(int[] list) {[/CODE] with no calls to any …

Member Avatar for NormR1
0
255
Member Avatar for JRDJ12

Hey all, I have an assignment that was assigned for the week that I could use some help on (not asking for someone to do it for me, just help with the step-by-step). Below is the requirements: 1) Create a new Java Project named whatever you'd like in your existing …

Member Avatar for stultuske
0
196
Member Avatar for ryanfsf

i want to ask something about my assignment. heres the code [CODE]#include <stdio.h> int main() { int nilaiuts[5],nilaiuas[5],nilaitugas[5]; int i; float total=0; printf("Masukkan nilai UTS mahasiswa [5 mahasiswa] :\n"); // proses memasukkan data ke array for (i = 0; i < 5; i++) { printf("Mahasiswa %i : ", i+1); scanf("%i",&nilaiuts[i]); …

Member Avatar for WaltP
0
208
Member Avatar for addbot101

/*Does the Bubble sort algorithm above sort the array into ascending or descending order?*/ void BubbleSort(int Data[ ],int ArraySize) { char sorted = ‘f’; int pass,a,Temp; pass = 1; while (sorted=='f' && pass<=ArraySize-1) { sorted = 't'; for (a=0;a<ArraySize - pass;a++) { if (Data[a] < Data[a+1]) { Temp = Data[a]; …

Member Avatar for rubberman
0
123
Member Avatar for flyingcurry

The method below for bubble sort should work, it displays the unsorted array fine, but for the sorted array it only displays one of the numbers. It seems to have just skipped over the other elements in the array. Here is a sample output: [COLOR="Green"]How many random even integers would …

Member Avatar for apines
0
170
Member Avatar for ohsevenfiveoh

hey guys,been browsing this site for a few weeks,but this is my first post. As you might guess by my problem I'm a C++ noob. I'm tryin to make a program in which the user inputs an array of double, I then use bubble sort to to get it into …

Member Avatar for Fbody
0
598

The End.