250 Topics

Member Avatar for
Member Avatar for needforkevin

hello! i have written a program to read in a text file and then ask the user to process the file with a different sorting method. so far i have been able to get my program to read in the file but my bubble sort seems to not be sorting …

Member Avatar for needforkevin
0
240
Member Avatar for cryonize

Can anybody tell me what's wrong with my selection sort of linked lists? It's meant to sort the whole node, not the data. #include <iostream> #include <iomanip> using namespace std; typedef struct node { int DATA; node *NEXT; }; node *HEAD = NULL; void Create(int data); void Display(); void Sort(); …

Member Avatar for Nick Evan
0
580
Member Avatar for MrHardRock

Hey guys, I recently had an assignment to write a sort algorithm we have not yet gone over in class. I had no problem getting my code written and to compile, but now that it compiles I keep getting an error that says "Exception in thread "main" java.lang.NoSuchMethodError: main" I …

Member Avatar for Ezzaral
0
227
Member Avatar for cryonize

Hello again, I am asked by my professor to create a program using selection sort in a linked list. Selection sort with sorting only the data is pretty easy, but I'm having a hard time because he made us sort the nodes themselves. Can anyone help by giving atleast the …

Member Avatar for mike_2000_17
0
10K
Member Avatar for rayan90

i have a single list program which i need to sort the nodes of int and String type unsing only one of these algorithms (insertion, selection, bubble and shell). no merge or quick or using collections and stuff. i'm having a difficulty here, i only know how to implement them …

Member Avatar for zeroliken
0
253
Member Avatar for cryonize

I was asked to create a program that enters numbers and displays the before sorting order, and the sorted order displaying the previous node address and the next node address. I was told not to swap the data inside the nodes, but move the nodes themselves. I have a problem …

Member Avatar for TrustyTony
0
9K
Member Avatar for jade_91

so heres my code [CODE] import java.awt.*; import java.text.*; import java.util.*; import java.util.List; // Explicit import required import javax.swing.*; public class Sort { public static void main(String args[]) { Runnable runner = new Runnable() { public void run() { String words[] = {"Sean", "Beth", "Ryan", "Bree", "Jim", "Bob"}; List list …

Member Avatar for NormR1
0
257
Member Avatar for jade_91

So basically I have to import a file of names and then be able to sort them alphabetically I've managed to import the file using the followig code [CODE] import java.io.*; public class Name{ public static void main(String[] args)throws IOException{ String contents; File f = new File("names.txt"); FileReader fr = …

Member Avatar for NormR1
0
503
Member Avatar for Ahmed2

hello there, I'm trying to sort a list according to the "length" paramter in ascending order, which represents the third coloumn. List elements are read from a csv file contains 9 coloumns, I only push 6 coloumns in "futurelist" which is the information i'm intersted in. //input csv data [CODE] …

0
102
Member Avatar for gabriellogan

I want to modify this Radix sort C++ to work with strings only. I want to sort words not numbers. I don't know what to change or where to change it. Any suggestions? [CODE] // CS 9F // March 3, 2012 // Include files #include <iostream> // used for cin, …

0
104
Member Avatar for minxminx

This is a code which sorts arrays. I use clock_t to determine the processing time for my code. However, it always stacks with the time taken from before. It looks like it's just adding the results. [code] int main(int argc, char *argv[]) {unsigned long n;//size of array -- long for …

Member Avatar for Labdabeta
0
543
Member Avatar for kiail

I'm trying to make a bubble sort to sort numbers like 3.2, 5.8, etc(double / float numbers). I have this code so far, but I'm still trying to learn and don't know why my code isn't working the way I think it should. Any help is appreciated. [CODE]using System; using …

Member Avatar for Momerath
0
269
Member Avatar for nik2012

Hello. I am learning C++, and I am a little stuck. Right now, I'm working on pointers. The problem I'm working on requires sorting an array of structures, using pointers instead of array indices, using a selection sort. My code is not working, and I can't quite figure out why. …

Member Avatar for nik2012
0
1K
Member Avatar for benclifford

Hi, I have a task to perform which all to do with the smurfs, reading from a file and doing some simple stuff to it. The last part I need to do is print out a list of all smurfs and their corresponding role in alphabetical order. I am hoping …

0
225
Member Avatar for linezero

[CODE]void merge() { if(start==NULL) { start=start2; } else { temp=start; while(temp->next!=NULL) { temp=temp->next; } temp->next=start2; } temp=start; if(start==NULL) printf("\nList is empty"); else { printf("\nElements of the list:\n"); while(temp!=NULL) { printf("%d\t",temp->info); temp=temp->next; } } system("pause"); system("cls"); main(); }[/CODE] the following code is use to merge two linked list into one and …

Member Avatar for thines01
0
182
Member Avatar for free2move

I need to sort a series of 25 numbers, entered by the user from smallest to largest, then count the number of times the user entered the number "10". I can't use arrays and I have to use only for loops, can someone please help?

Member Avatar for free2move
0
2K
Member Avatar for lupacarjie

See I created a program that accepts three values from the user to be arranged as a linked list(ascending order). After it asks a number, it displays the content of the list. The output is like this: [CODE]Enter number: 6 List value: 6 Enter number: 4 List value: 4 6 …

Member Avatar for lupacarjie
0
298
Member Avatar for n4j

Hello ,i have problem with code bellow. every data i enter it show me the weight '0'! Can you tell me how can i solve this problem? you should enter number of nods and edges and weight of each edge. [CODE] #include <stdio.h> #include <conio.h> #include <iostream> #include <Windows.h> using …

Member Avatar for n4j
0
253
Member Avatar for jaymayne

Need help making a module that sorts 4 arrays this how it started out void dataSort (float sLengthArray[],float rSlopeArray[],float speedArray[], float size) { void swap (int *x,int *y); int pass,j; for (pass=0;pass < size-1; pass++) { for (a = 0;j< size-1; j++) { if (slengthArray[j] > slengthArray[j + 1]) { …

Member Avatar for zeroliken
0
255
Member Avatar for srinath1
Member Avatar for patyypol

need to make a function that sorts integers from smallest to largest without using the sort function in python python must open a file with integers one per line store the data in a list then print the unsorted list then bubble sort code sorts the list from smallest to …

Member Avatar for TrustyTony
0
120
Member Avatar for rizzi143

HI ALL, well i am writing a program for quick sort but with some changes. The following code sorts the integers but i need it to show the sorting process in each steps.i.e. for example: Initial List: 5 -> 9 -> 2 -> 9 -> 7 -> null Level 0: …

Member Avatar for hfx642
0
232
Member Avatar for CE90

Hello every one...I have a project in which I must visualize different kinds of sorts in C by using GTK+ library. I mean it must show the numbers moving and getting sorted! I don't have any idea how to start and how to make the numbers move! I`ll really appreciate …

Member Avatar for Mouche
0
164
Member Avatar for apeiron27

my list looks like this: [(nStart, nEnd, nName),(nStart, nEnd, nName)...and so on] how do i sort first based on nStart, then on nEnd? thanks:)

Member Avatar for TrustyTony
0
57
Member Avatar for dhanlak

Hi, Does anyone know how to sort using linq-entity. i use the following code: from i in objEntities.Items where .... orderby i.Name select i The result is item1,item2,item21, item22, item3. But, i want it to be like item1, item2, item3, item21, item22 Thanks

-1
79
Member Avatar for pwolf

i have been working on this course work i got my hands on to learn python, and i have just been working on an exercise, i was wondering if i perhaps cheated though? The exercise says the following; write a function that takes a list of real numbers and returns …

Member Avatar for pwolf
0
277
Member Avatar for Smartflight

Hi, I'm learning C/C++ at school and we have our vacations; thought I might do some programs on my own. I've landed at trouble with sorting numbers in a 1-D array at the time of insertion. It seems to work up to a certain point, after which it fails to …

Member Avatar for Smartflight
0
354
Member Avatar for JavaPrograms

Assignment :: TwoLargestElements Complete the following program so that it computes and writes out the two largest elements in the array. So far I have this...and it just gets the largest number for both outputs..I need to change it so I get both the largest and second largest. Any help …

Member Avatar for rickypounting
0
2K
Member Avatar for adaniel058

My teacher has assigned us a HW to do and I can not seem to figure out how to group the results the way he wants them. What we have is a database of properties and owners. He wants us to generate a report that contains only the Owner names …

Member Avatar for jcarbillon
0
196
Member Avatar for Assassin7893

Guys, I'm actually almost done. Basically what I have to do is to read from file with a list of words, sort them alphabetically and write them into another file. I am almost done, but the only thing is, the assignment says that we shouldn't change the case of words, …

Member Avatar for v3ga
0
2K

The End.