163 Topics

Member Avatar for
Member Avatar for Reverend Jim

##vbScript - Sorting With and Without Code Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. Sorting is something that must be done from time to time. I'm going to examine three ways. The first is the well known (at least by name) QuickSort method. Rather …

1
1K
Member Avatar for chrisschristou

hello, i just set goal of mastering algorith and i just get started i have an algorhtm for insert sort and i when i write it in c it is not sorting this is the algorith for j D 2 to A_length key = A[j] // Insert A[j] into the …

Member Avatar for rproffitt
0
415
Member Avatar for rproffitt

http://imgur.com/gallery/dYgFh has a gallery of some visualizations of classic sorting. For your enjoyment. And with sound too! https://www.youtube.com/watch?v=kPRA0W1kECg This post is strictly for programming's secret pleasures.

2
238
Member Avatar for DS9596

I have to sort the 5 elements in a, the Days and the Vowels. How do I use the template <class T> with the way I put this?? #include <iostream> #include <algorithm> #include <iomanip> using namespace std; // Function prototypes void DisplayA(int[], int); void showArray(int[], int); void DisplayB(string[], int); void …

Member Avatar for nullptr
0
398
Member Avatar for psvmr

I am trying to sort averages of scores in a class by pupil, from highest to lowest. My data is stored in text files like this: Charlie:0 Seema:2 Amber:4 Paige:5 Amber:8 Keith:1 Charlie:8 Seema:0 Charlie:9 Seema:3 Paige:0 Paige:4 Paige:4 Charlie:1 Keith:5 Keith:3 Here is my code so far: with open("class …

Member Avatar for vegaseat
0
961
Member Avatar for nightcrew

[QUOTE]Assume you have a int variable n that has already been declared and initialized. Its value is the number of integers that need to be read in from standard input and printed out in sorted (ascending) order, each on a line by itself. Furthermore, there are no duplicates in the …

Member Avatar for omgerg
0
3K
Member Avatar for it@61@sec

I have the following struct definition: struct finfo { string filename; long fsize; bool operator() (finfo i, finfo j){return (i.fsize > j.fsize);} } fstruct; And the following vector definition: vector<finfo> fdata; In the code I use the following statement to sort the vector elements by fsize: sort(fdata.begin(),fdata.end(),fstruct); This works perfectly …

Member Avatar for it@61@sec
0
951
Member Avatar for rayhaneh

I'm new at C++ ..and I dont know what should I do whith my program ... this program's input for exg. is: 5 mary sara kimi lili olive : : and then sorting them .. but my problem is that when I submit my home work they score me "0" …

Member Avatar for rayhaneh
0
223
Member Avatar for Diellza

I want to write a code for Radix Sort based in this way how I made the Quick Sort, how can I do with Radix Sort, can anybady have any idea I have search a lot but I can not find any exactly what I need #include <iostream> #include <conio.h> …

Member Avatar for David_50
0
613
Member Avatar for Diellza

I want to make this code with random numebr array and time executation? Does anybady nows how can I do? #include <iostream> using namespace std; void print(int a[], int sz) { for (int i = 0; i < sz; i++ ) cout << a[i] << " "; cout << endl; …

Member Avatar for Diellza
0
283
Member Avatar for brakeb

I have been beating my head into the desk with this issue, and I don't think it's a simple 'uniq' or 'sort' issue. I have a file, with many duplicate values in them. File ---------- dog dog cat owl owl turkey weasel giraffe giraffe rooster The output I am looking …

Member Avatar for brakeb
0
193
Member Avatar for mavtcr

Earlier I raised a question in this forum regarding the sorting of database and Reverend Jim answered me as follows. It was Ok SELECT * FROM mytable ORDER BY fieldname But then I faced another problem As I mentioned in that I wanted to sort ORDER by 'Tdate' which is …

Member Avatar for pritaeas
0
282
Member Avatar for root404

Hi evryone! :) I'm a complete beginner in Java and today i'm found my self stack while trying to solve a problem. Basically what i have to do is to write a program that sorts three integers. The integers are entered from the input dialogs and stored in variables num1, …

Member Avatar for JamesCherrill
-1
1K
Member Avatar for mavtcr

Friends I met with a problem...Please help I have a table 'Tran' in Access Database which has several fields of which one is 'Date' I added several records through programm on different dates.Everything OK. All the records appeared in a chronological way ie.Earlier to Later order . Later I deleted …

Member Avatar for mavtcr
0
339
Member Avatar for tbuchli

/* * File: main.cpp * Author: TBuchli * * Write a program that helps a real estate agent calculate an average price of *up to 20 homes. An array of data type double should be used to contain the *prices. The program should prompt the user to enter the number …

Member Avatar for richieking
0
274
Member Avatar for gaurav23

#include<fstream.h> #include<conio.h> #include<string.h> #include<stdio.h> void main() { clrscr(); ofstream fout("a"); fout<<5<<"\n"<<3<<"\n"<<2<<"\n"<<4<<"\n"<<1; fout.close(); ifstream fin("a"); int i,j,k,l=0,m,n,o; while(fin) { fin>>i; l++; } l--; fin.close(); fstream fin1("a",ios::ate,ios::in); fin1.seekg(0); for(i=0;i<l-1;i++) { for(j=0;j<l-i-1;j++) { o=fin.tellg(); fin1>>m; fin1>>n; if(m>n) { fin1.seekg(o); fin1<<n; fin1<<m; fin1.seekg(o+1); } } } } //file sorting is not working if anyone …

Member Avatar for gaurav23
0
220
Member Avatar for ej.p.lopez

good day can anyone help me with my sort by? nothing happens when clicking the sort no errors tried the codes 4 years ago don't know if it's still usable the sql.= i think don't work or my other query just disables it. here's my sql command thanks :D. help …

Member Avatar for broj1
0
238
Member Avatar for toxicandy

Currently I am designing a inventory system, however jumping straight into vb.net was easier said than done. At the moment, all the information stored goes to two places, one being a master file that has all the information ever inputted, and the other being an individual file that is created …

Member Avatar for tinstaafl
0
268
Member Avatar for seacase

I am trying to modify my shell sort algorithm to use Hibbard's increments rather than n/2. I know that Hibbard's increments are 2k - 1, but I can't figure out how to incorporate that into my algorithm. Any suggestions to help me move forward with this? I feel like I …

Member Avatar for Mohamed_22
0
4K
Member Avatar for Labdabeta

Hello, I am very familiar with most of the sorting algorithms that are taught in first year university (as I just finished my first year in software engineering at the University of Waterloo). As such my current go-to sorting algorithms are insertion (on mostly pre-sorted data, or data where I …

0
217
Member Avatar for iamspix

I have these sorting algorithms in my application, and I want to keep track the affected values, or the values that swapped during the sorting process. I want to highlight them. I have solved this issue for bubble sort and selection sort, but somehow I can't get it work with …

Member Avatar for Airshow
0
289
Member Avatar for dendenny01

My Program contains 4 arrays and I want to sort the array in such a way that if one array is sorted the other array should follow it Example: unsorted array name code salary date John 52 6500 15 Suzzy 10 1500 20 Mike 20 1451 16 Sorted array(according to …

Member Avatar for Adak
0
225
Member Avatar for tony75

Hi Any idea how to solve an old exercice? The linux command ls -alR produce informations about files contained in the current directory and its subdirectories. You can save its output by using redirections (in the file output in the following example): ls -alr > output The exercice is to …

Member Avatar for 2teez
0
254
Member Avatar for HankReardon

Hello, What is the best way to count the number of swaps required to sort an array that is sorted using the Quicksort algorithm? I put a counter in what I believe is in the correct position and the tests that I have run seem to be correct however Quicksort …

Member Avatar for JamesCherrill
0
4K
Member Avatar for HankReardon

Hello, What is the best way to check my code? I have written a program that counts the swaps required to sort an integer array using the Bubble, Selection, Insertion and Quick sort methods. How can I be absolutely certain that my swap counts are correct? Will someone take a …

Member Avatar for HankReardon
0
3K
Member Avatar for awfootball7

Hey guys looking for some help with my ArrayTester class... The array is supposed to 1.create a 20 element int array and populates it with random elements in the range 20 through 65 (both inclusive). -I Believe I have already done this. 2.Use the java.util.Random class with a seed of …

Member Avatar for stultuske
0
323
Member Avatar for Duki

Hey guys, I'm trying to understand how radix sort works in C++ : I've looked over the C++ implementation from wikipedia: void radixsort(int *a, int n) { int i, b[MAX], m = a[0], exp = 1; for (i = 0; i < n; i++) { if (a[i] > m) m …

Member Avatar for deceptikon
0
308
Member Avatar for dp121307

I tried to use a different forum but I was completely out of my league with the responses. I am extrememly new to python. As a project, I'm supposed to ask the user to input a file name, check that the file exists, output the numbers in the file, and …

Member Avatar for vegaseat
0
20K
Member Avatar for bymak87

I am supposed to create a file that will generate 100 random numbers and then sort them. I am stuck on the sorting. I think it would be a really simple solution but i cant seem to figure it out. I have tried the arrays utility and creating a method …

Member Avatar for nate.nelson.566
0
1K
Member Avatar for Begginnerdev

Hello my fellow Daniwebers! I am having some problems wrapping my head around the task sorting a List(Of CustomType) I have a list containing a custom class. The class contains Two DateTime objects, Start and End. I am trying to sort the list descending so that the shortest timespan will …

Member Avatar for Begginnerdev
0
439

The End.