235 Discussion / Question Topics

Remove Filter
Member Avatar for
Member Avatar for Coderunner

Hello helpers, I'm having a problem with sorting (3rd column) a flat file. flat file looks like this: 20210103|~|3 jan 2021|~|Harold|~|m| 20210121|~|21 jan 2021|~|Elly|~|f| 20210213|~|13 feb 2021|~|Silvy|~|f| 20210330|~|30 mrt 2021|~| George|~|m| Now I want to save it in a new flat file sorted on the **3rd column** Result: 20210121|~|21 jan …

Member Avatar for Coderunner
1
136
Member Avatar for random_1

Hi, i want to sort divs alphabetically both asc and desc. I am using a dropdown list created by using bootstrap: <div class="btn-group"> <a href="#" data-target="dropdown-menu" class="btn btn-default btn-block dropdown-toggle" data-toggle="dropdown"> Sort By <span class="caret"></span> </a> <ul class="dropdown-menu" style="width: 100%;"> <li><a href="#" class="nameAsc">Name: A to Z</a></li> <li><a href="#" class="nameDes">Name: Z …

Member Avatar for gentlemedia
0
4K
Member Avatar for Iamateur

Hie,I have Merge Sort Program .It's giving correct output but when checked through debugger it gives different values everytime.I also tried doing it manually but I am not getting the actual output. I will not ask now for complete program explanation. I just want to know the value over here.This …

Member Avatar for rproffitt
0
385
Member Avatar for CS_GUY1234

// Also attached to this question is the assignment sheet. Need help pls. import java.util.*; import java.awt.*; import java.applet.*; public class Lab15st extends Applet { private int numBars; // number of bars to be sorted private int barHeight[]; // array of bar heights private int sortDelay; // delay between comparison …

Member Avatar for CS_GUY1234
0
509
Member Avatar for Dhelandel
Member Avatar for JamesCherrill
0
259
Member Avatar for mariam_4

i should to move the biggest value to the last index in the array then to print the array. when i print it i get things like letters, smiles... what is the wrong in the code? .model small .stack 100h .data array db 3,8,5,3 n equ 4 b db dup …

Member Avatar for rproffitt
0
273
Member Avatar for Sibghah

I have to store the scores of people in a text file as an array, and I should be able to add each record on the array. This is the part of the code where the scores are being stored: if group == "a": with open("class scores A.csv", "a+") as …

0
185
Member Avatar for Sibghah

I need to sort some information from an array. I'm trying to find the minimum value out of two numbers, from a csv file, the first part of the information in the file is the names of people, so instead of 0, I put 1 in int(row[1]) import csv print("1 …

Member Avatar for Sibghah
0
227
Member Avatar for claptus

Let assume that ‘k’ is an integer that indicate and reveals exactly the length of subset that sum to 0. Thus length of subset to pick is determined by ‘k’. If I would like to pick only ‘k’ distinct set of integers from any given set of integers in polynomial …

Member Avatar for Reverend Jim
0
297
Member Avatar for khaled02

Hi, I hope you can help me out of this because i really dont understand how to fix this code anymore, i tried and tried and it don't work. When i debug this code in Microsoft Visual Express 2010, it says the following erros are: 1>------ Build started: Project: Adreesbook2, …

Member Avatar for khaled02
0
236
Member Avatar for Amiet_1

I have DatagridView on form. My database has three fields. - userId (bigint) - userName (varchar) - userDob (date) Now, on Form I have comboBox, which lists Months (Jan, Feb, March and so on...). I want my program to work like this. If I select any month on ComboBox, birthdays …

Member Avatar for djjeavons
0
493
Member Avatar for Hector_2

This is supposed to used quick sort using the header "arrayListType.h using quick sort and get the numbers entered smallest to largest but I'm not sure on how to do it. Can I please get some help? #include <iostream> #include "arrayListType.h" #include <cstdlib> using namespace std; void printList(arrayListType<int>& list); void …

Member Avatar for rubberman
0
415
Member Avatar for Anil2447

Here is the code for [B][COLOR="Red"]Insertion Sort, Bubble Sort and Selection Sort[/COLOR][/B] [B]Insertion Sort[/B] [CODE] #include <stdio.h> main() { int i,j,key; int a[5]={5,2,3,4,1}; for(i=1;i<5;i++) { key=a[i]; while(i>0 && a[i-1]>key) { j=a[i]; a[i]=a[i-1]; a[i-1]=j; --i; } } int k; for(k=0;k<5;k++) {printf("%d ", a[k]);} printf("\n"); } [/CODE] [B]Bubble Sort[/B] [CODE] #include <stdio.h> …

Member Avatar for Talha_5
0
9K
Member Avatar for psvmr

I have been trying to create a program which the teacher log in to view the scores of a test of a school class. The scores are stored in a text file like this: Charlotte:7 Charlotte:4 Charlotte:3 Chelsea:2 Chelsea:9 Chelsea:5 Jeff:1 Jeff:10 As you can see there are multiple scores …

Member Avatar for vegaseat
0
670
Member Avatar for marcelmarcelmarcelmarcelmarcelmarcelmarcelmarcel

Hello, for a school assignment I was supposed to write an insertion sort algorithm for a doubly linked list. As the feedback system of this particular course is rather weak (actually non-existent) I would like to ask you for your honest opinion about how well this is implemented, what could …

Member Avatar for David W
0
2K
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
224
Member Avatar for Diellza

Dear all, I need the code for counting sort algorithm but I try this code but is not working #include <iostream> #include <conio.h> #include <time.h> #include <stdlib.h> //srand and rand functions using namespace std; void add_random_numbers(long arr[], long b); void countingSort( long left, long right, long vector[], int k, long …

Member Avatar for deceptikon
0
787
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
284
Member Avatar for Diellza

I want to do one example of Radix sort generating random numbers and timing. Can anybady help me? Here is the radix pseudocode function radixSort(String s) for i in (s.length - 1) -> 0 do stableSort(s[i])

0
176
Member Avatar for Sunil_12

Hello All, I want to write a c++ code to sort a queue with the help of another queue and a non array element. Please help me getting the code.

Member Avatar for Sunil_12
0
596
Member Avatar for Tycellent

Hey Guys, Was wondering if anyone could help me with this sort function for a vector of struct type. What i'm aiming to do is to make a score board being based on a player's score and print out the scores (along with the name) in descending order. I've looked …

Member Avatar for Tycellent
1
445
Member Avatar for perly

Hi, I have a 3-column data (below) from excel file. How can I write a perl code to sort all rows according to the first numeric number of a numeric interval and the word "complement" if they appear before the numeric interval as shown in the expeceted output below? Data: …

Member Avatar for Hiroshe
0
244
Member Avatar for phony

I'm supposed to create a program to sort a names.dat file. It compiles but nothing is displayed. names.dat Collins, Bill Smith, Bart Michalski, Mel Griffin, Jim Sanchez, Manny Rubin, Sarah Taylor, Tyrone Johnson, Jill Adams, Andrew Moreno, Juan Wolfe, Bill Whitman, Jean Moretti, Bella Wu, Jeff Patel, Renee Harrison, Rose …

Member Avatar for nullptr
0
318
Member Avatar for george08.08

I am trying to get my head around the functions etc in xslt with xml. I have made a dummy xml file <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="books.xslt"?> <books> <book> <title>Hello Dolly</title> <author>John Thumb</author> <readers> <young_readers>17</young_readers> <older_readers>23</older_readers> <total_readers>40</total_readers> </readers> </book> <book> <title>Goodbye John Thumb</title> <author>Dolly Smith</author> <readers> <young_readers>12</young_readers> <older_readers>3</older_readers> <total_readers>15</total_readers> …

Member Avatar for george08.08
0
277
Member Avatar for Praveen_10

#include <cstdlib> #include <ctime> #include <iostream> using namespace std; int findSmallestRemainingElement (int array[], int size, int index); void swap (int array[], int first_index, int second_index); void sort (int array[], int size) { for ( int i = 0; i < size; i++ ) { int index = findSmallestRemainingElement( array, size, …

Member Avatar for vmanes
0
314
Member Avatar for mystycs

Is there a way to sort a vector with a class that has an int variable? I want to have my vector sorted and printed in console. I want to be able to sort the vectors. Say i create a bunch of vectors here on user input `vector<PCB> Disks2[DiskDevices];` Basically …

Member Avatar for Schol-R-LEA
0
414
Member Avatar for michelle.trinsky

I'm trying to create a sorted linked list without using Collections. I don't want to use Collections since I'd like to learn how to work with Linked List manually. I'm getting NullPointer exception when I'm comparing strings and comparison <0. Any suggestions and help are appreciated. This is the part …

Member Avatar for stultuske
0
1K
Member Avatar for Hector_2

I can't get the code to display in an ordered list. // Chapter 5 - Homework Assignment #include <iostream> #include <cstdlib> using namespace std; // // DECLARE FUNCTION HEADER FOR // CLASS ListNode class ListNode { public: ListNode(double v, ListNode *p) { value = v; next = p; } private: …

Member Avatar for Hector_2
0
191
Member Avatar for knan

I have a dictionary [CODE]dict1={'18':['4000','1234'],'12':['7000','4821','187','1860','123','9000']}[/CODE] I want to sort the keys and values such that, the output is, [CODE]dict1={'12':['123','187','1860','4821','7000','9000'],'18':['1234','4000']}[/CODE] I tried something! but it didn work [CODE]>>> for values in dict1: ... dict1[values].sort() ... >>> dict1 {'18': ['1234', '4000'], '12': ['123', '1860', '187', '4821', '7000', '9000']}[/CODE] Full sorting happens for …

Member Avatar for grantjenks
0
806
Member Avatar for Thevenin

I am trying to order by date DESC some events read from a CSV and print out them. The CSV file has to be read until it reaches the end and then order by date DESC only the entries in the following categories: champions and euro. This is the code …

Member Avatar for Thevenin
0
2K

The End.