250 Topics
|
|
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' … |
|
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, … |
|
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') … |
|
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 … |
|
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. |
|
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; … |
|
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 … |
|
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 … |
|
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 … |
|
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 |
|
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++) … |
|
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 … |
|
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 … |
|
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 … |
|
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.. |
|
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; … |
|
>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 … |
|
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, … |
|
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 … |
|
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. … |
|
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. … |
|
-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 … |
|
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 … |
|
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 … |
|
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 … |
|
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) = … |
|
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 … |
|
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] = … |
|
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 … |
|
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 … |
The End.