250 Topics

Member Avatar for
Member Avatar for Secone

Here's the entirety of my code. The problem I'm having trouble with is in the sortArray function. The first part of that function is used to sort the words gathered in a text file from A to Z, the second part is meant to find any duplicate words, ie 'a' …

Member Avatar for Secone
0
205
Member Avatar for Secone

Hello, I'm trying to have my program locate any duplicate strings in an array, say, there were two instances of the word 'man', it would add 1 to the Word Amount of that word, and move the duplicate to the back of the array in some way. The problem is, …

Member Avatar for vijayan121
0
235
Member Avatar for python1956

I am trying to sort by key, but it's not working because I don't think that the thing that I'm trying to sort on counts as a list (in fact I think it is an ndarray?): y = np.genfromtxt("1400list.txt", dtype=[('filename','S20'),('freq','S20')]) gives me y as something in the form: [('a070918_215953.SFTC', '1369.000') …

Member Avatar for Lardmeister
0
4K
Member Avatar for edwarddaniel.baldeviano

Hi, everyone! This is my first post ever here in Daniweb. I experienced a problem in printing the sorted array of 5 numbers, as the following code only prints the first iteration of the loop, and it does not print the array input. Here's the code: section .data i db …

0
591
Member Avatar for Reverend Jim

This is a short bit of code that shows how to implement sorting on columns in a details-mode ListView. Suggestions for improvement are always welcome. One possible improvement would be to modify the column headers to indicate which column is being sorted and in which direction.

0
2K
Member Avatar for Johns3

So I have successfully implemented a search feature into my tiny program but when I click the button to sort, it works fine but the images don't display. In the columns called "A" and "B", images are supposed to show up but they don't. http://i46.tinypic.com/2mx3og8.jpg . import java.awt.Color; import java.awt.Component; …

Member Avatar for Johns3
0
237
Member Avatar for rotten69

Hi there, why does the sort function not sort out numeric values depending on their values(large to small or small to large)? var drinks1 = [40,30,10,20,100]; println(drinks1.sort()); // this will give you 10, 100, 20, 30, 40 it sorts those values as follows: 10,100,20,30,40 Is there a way of changing …

Member Avatar for pritaeas
0
276
Member Avatar for Reverend Jim

Sometimes sorting data can be easy and sometimes it can be difficult. If you have data in a listview you can spend a great deal of time writing ICompare functions. This is appropriate for non-trivial applications but can be a little intimidating for inexperienced programmers. Also, it is a problem …

Member Avatar for Reverend Jim
1
884
Member Avatar for latooplat

I have a special problem over in terms of sorting out those words like a keyboard type. For example: the user inputs these words into the textarea HOUSE DOLL KITE NICE Then, the result should be DOLL HOUSE KITE NICE this is sorted out according to the qwerty order. <?php …

Member Avatar for pritaeas
0
1K
Member Avatar for muditvijay

hi guye please help how to sort a file like: with phone no. name;class; phone no mudit;5th;987654321 rohit;4th;98745321 sumit;7th;987654321 ankit;9th;984321 aaa;5th;987654321 bbb;5th;9874321 ccc;4th;98765421 ddd;8th;9876543

Member Avatar for Cross213
0
126
Member Avatar for vasvigupt

I trying to sort an array ising php but this code is not working. can any body tell me whats wrong with this code, is my logic is right or wrong. I don't know much about Php as I am new to learning php <? php $a= array(12,5,78,10,63,11); $size=$sizeof($a); for($i=0;$i<=$size;$i++) …

Member Avatar for Que336
0
270
Member Avatar for Danja

Hello all, I have a long list of coordinates which are supposed to trace the outline of a city. They are supposed to go into a program which plots the trajectory from one coordinate to the next, thereby plotting the outline. For some reason (I'm not sure why; I'm trying …

Member Avatar for hkwhitten
0
982
Member Avatar for bulqr4eto

I need a BIG HELP, first I want to say Im REALLY BAD with PHP :D so basically I have a php script witch auto generate list of videos from a folder on my host with 1 media player http://img687.imageshack.us/img687/5915/snap20120703at155809.png - As you can see there are too many clips …

Member Avatar for diafol
0
166
Member Avatar for <M/>

How do I sort this loop? I can't sort it because I just began learning PHP, so I don't know as much as most of you users... Can anyone help me? <?php $red = array(); $x=0; $min=500; $max=2000; echo "<table border=\"1\">"; for($row=1;$row<=20; $row++){ echo "<tr>\n"; //Need table ONE to have …

Member Avatar for somedude3488
0
220
Member Avatar for shibu2all

void insertion_sort(int *a, int n) { int for(i=1;i<n;i++) { value=a[i]; for(j=i;j>0 && value<a[j-1];j--) a[j]=a[j-1]; a[j]=value; } } can anyone pls explain me the flow of this code... i am having confusion in understanding the flow..

Member Avatar for TrustyTony
0
225
Member Avatar for shibu2all

void selection_sort (int *a, int n) { int i, j, m, t; for (i = 0; i < n; i++) { for (j = i, m = i; j < n; j++) { if (a[j] < a[m]) m = j; } t = a[i]; a[i] = a[m]; a[m] = t; …

Member Avatar for shibu2all
0
250
Member Avatar for dwhite12

>I need to take a list of files and remove a '.2' from a line in each file. I then need to rewrite the file without the '.2'. Using the code below I am >able to take a single file and do exactly what i need to but when trying …

Member Avatar for Lucaci Andrew
0
247
Member Avatar for Sasstraliss

Quickselect, based on quicksort, and counting select, based on counting sort. Each is capable of finding the kth smallest element in an unsorted/sorted list/array. This is some example code for a QuickSelect algorithm. This doesn't include the partition function. // return the kth smallest item int quickSelect(int items[], int first, …

Member Avatar for mike_2000_17
0
523
Member Avatar for spowel4

I have a list of type <string[]>, and each item in the list is a one-dimensional array. I need to sort the list according to a particular field in the arrays, how can I do this? An illustration for clarity: list item #1 = array(112, Maxwell Smart, MIS) list item …

Member Avatar for Mitja Bonca
0
1K
Member Avatar for kumarprashant

can anyone kindly help me in writing a program for creating an address book. Its kinda urgent and I ll be really grateful. program description: develop a program for an address book.single entry in an address book is called a contact, which can have any of the following fields, 1. …

Member Avatar for JGorard159
0
233
Member Avatar for kumarprashant

can anyone kindly help me in writing a program for creating an address book. Its kinda urgent and I ll be really grateful. program description: develop a program for an address book.single entry in an address book is called a contact, which can have any of the following fields, 1. …

Member Avatar for deceptikon
0
4K
Member Avatar for matharoo

-53 45 -54 43 -55 42 -56 41 -57 40 -59 37 -61 35 -61 36 -62 34 -64 33 -65 31 -65 32 -67 30 -68 29 -69 28 -72 25 -73 23 -73 24 -74 22 -76 20 -76 22 -78 20 -79 18 -80 17 -81 16 …

Member Avatar for b1izzard
0
250
Member Avatar for dinosaur123

Hello again! I am still working on a program, and I am now working on sorting an array. Well, the array is a bunch of strings read from a text file. Some of the strings were turned into integers. I need to take the strings and find a way to …

Member Avatar for dinosaur123
0
264
Member Avatar for jimjones371

Need help from daniweb community. I suck at programming. It doesn't make sense to me. I'm not going to be programming in my career but it's part of my major. I'm desperately trying to get an c- just to pass. Would love some help. I would appreciate some explanation but …

Member Avatar for gusano79
0
281
Member Avatar for fonzi

Hello I am currently working on this code and the code can be runned well from 100-10,000 random elements after that the heap sort says stack over flow, im thinking the recursive calls are the cause of this, so please healp public static void MAX_HEAPIFY(int [] A, int i, int …

Member Avatar for JamesCherrill
0
307
Member Avatar for zhouy

Dear All, I have two arrays (array1 and array2)with double type data. I want to sort array1 to ascending order, and array2 with corresponding to the array1 indexes. Is this possible? Example below, Array1(0) = 2.30 Array1(1) = 4.20 Array1(2) = 1.90 Array1(3) = 0.20 Array1(4) = 0.88 Array2(0) = …

Member Avatar for zhouy
0
245
Member Avatar for dariaveltman

hi everyone!!! I am trying to write a code for list of names to be sorted in alphabetical order. can anybody please tell me what I am doing wrong. and one more thing , is it possible to bubble sort a names in unspecified number of entries? and if it …

Member Avatar for Lerner
0
246
Member Avatar for dariaveltman

please tell what am I doing wrong. #include <iostream> using namespace std; int main() { char name[3][30]; int i, j; for(i=0;i<=2;i++) { cout << "Please enter name: "; cin >> name[i]; } for(i=0;i<=1;i++) { for(j=i+1;j<=2;j++) { char temp; if(name[i] > name[j]) { temp = name[i]; name[i] = name[j]; name[j] = …

Member Avatar for Sahil89
0
179
Member Avatar for cryonize

I have a bit a of a problem because I have no idea what's going on in my code. Could someone guide me with this? **It has to swap the nodes themselves. ** #include <iostream> #include <iomanip> using namespace std; typedef struct node { int DATA; node *NEXT; }; node …

Member Avatar for raptr_dflo
0
960
Member Avatar for TheWind147

Below is a merge sort function provided by my instructor, my task is to create a program that asks the user to input numbers in random and choose which type of sorting algorithm he wants to use to be able to sort the numbers, I managed to finish quick sort …

Member Avatar for TheWind147
0
323

The End.