Most voted "classification" questions
Sorting algorithms are used to lay out the elements of a given list in a certain order defined according to a desired parameter.
Learn more…290 questions
Sort by count of
-
1
votes0
answers71
viewssee how many times a number changes position in c++ using Bubblesort
Could someone give an example of how I would do that? Type, a size 5 vector, with the following numbers: 33.64.21.85 and 15. I wonder how many times he compares the numbers and performs the…
-
1
votes0
answers134
viewsParallelization of Bubblesort Open-MP C++
I’m trying to paralyze the bubblesort algorithm using Open-MP and C++, and the parallelization strategy is pipe. The following code, to me, makes sense, but it doesn’t work, and only sorts the…
-
1
votes1
answer275
viewsSort class list in Python
I have a class defined as follows:: class Cromossomo(): def __init__(self, cromossomo, comprimento): #Construtor self.cromossomo = cromossomo self.comprimento = comprimento From it I have a list of…
-
1
votes1
answer100
viewsHow to apply "goto" to quicksort? (c, c++)
I’m doing a job for my college where I ask for a quicksort algorithm to be done in C, using "goto" as much as I can. In the code below I applied the "goto" as far as my knowledge allows, but I would…
-
1
votes1
answer329
viewsHow to sort a select option alphabetically with jquery?
I have a select option to list through a each in jquery what I intend to do now and order that each by alphabetical order when listed. Jquery $(document).on("click", ".btn-add-agent-proximo",…
-
1
votes2
answers1072
viewsHow to order Record in Delphi (similar to ORDER BY)?
I bring some bank records with a specific sorting and play into a vector of the type record. Then I need to add more items in this array keeping the initial sort. How the sort is done in the SQL the…
-
1
votes0
answers52
viewsSort Metrogridview content by clicking on the Heder title of a particular column
Hey, guys, I got a problem, I’ve been fighting for a while. I am using in my application Metroframework and Linq,and noticed that Metroframework does not have certain properties or that they do not…
-
1
votes1
answer462
viewsProblem in ordered insertion code of structs (records) in files
I am doing a work in which I have to insert structs in alphabetical order in archives, in which the structs are political and the archives (which together form a chained list) are the parties. I’m…
-
1
votes1
answer1412
views(JAVA) Help in Sorting Exercise (Selection Sort and Insertion)
/*EXERCISE: Write a method that puts in ascending order a disordered sequence of n integer. (a) Using sorting by selection (b) Using sorting by insertion*/ I tried to solve the exercise, but I’m…
-
1
votes1
answer629
viewsSorts Names - Javascript
I need to create an HTML document where the user can add names to a numbered list (OL). Your document must have a text box (an input for typing text) where the user can enter one name at a time. In…
-
1
votes1
answer159
viewsSort by id in Angularjs (Javascript)
I have an Angularjs object: $scope.listaDoCarrinho = [0: { id: "55", setor: "alimento", foto: "Produtos/Produto (55).jpg", descr: "Espaguete Renata", de: 15, … } 1: { id: "1000", setor: "biscoitos",…
-
1
votes2
answers771
viewsSort foreach in php
I made a page that shows the hash in several hash_algos in order to study their differences, but I would like to sort by the hash size and not by the hash_algos name, the code is this, <?php…
-
1
votes1
answer58
viewsSort an array within an object, entering all hierarchies of it
I own an object that contains several arrays within it. And these arrays contain other objects that contain a field lpec_sequence that I would like that under every hierarchy, it was ordered by that…
-
1
votes1
answer42
viewsJavascript - It is possible to have a universal ordering function
I have an object called report and I have a report vector and I need to do several sorts, so I thought I would do an ordering function that was "universal". I wanted to be able to pass the attribute…
-
1
votes0
answers69
viewsHow did Mandar Sort view URL in native pagination query?
The structure below works perfectly, but when I send after the input and pagination data the command Sort it from the Sql error, which I need to put in the query to accept the Sort for the field I…
-
1
votes2
answers51
viewsHow to simplify the process of classifying a value-based hash
Oops, I’m new to the site, and I’m new to Ruby. My question is: Is there a more efficient way to classify a hash according to the values? I did the code below, but I’m sure it’s not the most…
-
1
votes1
answer900
viewsSort a chained list with Java Selection algorithm
I am working on sorting algorithms. I have implemented sorting with Bubble Sort, however, must be implemented with an example where the algorithm is not stable( Selection ,Quicksort, Heapsort or…
-
1
votes2
answers113
viewsQsort ordering in the wrong way
My activity is to read a sentence and ordered in alphabetical order, but is giving error #include <stdio.h> #include <stdlib.h> #include <string.h> int ordena(const void * a, const…
-
1
votes2
answers456
viewsString Field List Sorting
I have a List with attributes, of which I have the field of reviews, containing: Excellent, Good, Regular, Bad, and Bad. The information for this field I get from the consumption of a REST API using…
-
1
votes1
answer124
viewsreverseOrder() In java not reversing
I have a method in java to sort a vector in a decreasing method, but when I run the test it returns me the unpaired vector. Follows the Method: public void sort() { int vet[] = this.vetor;…
-
1
votes0
answers153
views(c) Sort Struct Matrix
Good to all! I have a little problem that I can’t solve and I seek help from the members. In my code, I read the contents of a file and save in a string for use in the code, in the main loop, I…
-
1
votes1
answer42
viewsOrdering With a certain condition
I made the point Who’s Going to Fail? that had the rule Students would be ordered according to the number of problems solved, with draws solved according to the alphabetical order of the names…
-
1
votes0
answers111
views(Clarification) Artificial intelligence Word classification (Python)
I was trying to do something to fulfill that need: Read the word Hit a dictionary E Try to complete the word (if possible) For example: ENTRADA: CSA DICIONARIO ["HOMEM", "CASA", "MULHER"]` SAIDA:…
-
1
votes1
answer87
viewsHow to use variable in Javascript Sort?
I am doing a javascript sort from the Sort method, but I wonder if it is possible to use a variable to represent the attribute that will be used for sorting since this attribute may vary. The code…
-
1
votes1
answer327
viewsOrdering cards in Python
I have a list of the cards and the suit of a deck that I need to sort. Considering the correct order: A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K And the suits: P(clubs). O(gold), E(sword), C(hearts)…
-
1
votes0
answers109
viewsTAD Alphabetical Order Method List
This is the first topic I’m posting, I’d like you to help me with this problem. The problem is based on ordering data entered in a Dynamic List (C#) according to name (Alphabetical order). As it is…
-
1
votes1
answer251
viewsBucket Sort - C
I’m having problems implementing the Bucket Sort sorting method, I need to test it 30 times with different amounts of data, but when I try with 100000 it presents me this error: "Process returned…
-
1
votes0
answers35
viewsData ordering C
I am doing an ordering job where the program should read a text file with several lines and do the ordering of values. are 6 files, one with 10000 records, another with 100000 records, another with…
-
1
votes2
answers1773
viewsHow to sort a list of objects in Dart?
Future<void> _getAllPesagens() async { List<Pesagem> pesagemFinal = List(); await pesagemHelper.getAllPesagems().then((listaP) { print(listaP); if (listaP.isNotEmpty) { for (var peso in…
-
1
votes1
answer173
viewsBucket Sort in Python: The array is only partially ordered!
I’m trying to implement the algorithm Bucket Sort. The code below implemented only "1 round" (considering the numbers from right to left) of the algorithm, in which the array [97,3,100] turned into…
-
1
votes1
answer93
viewsSorting objects in Javascript
Good evening, I’m having a difficult to sort array in javascript, the problem is that I need to sort it first by number of characters, ( Words with more characters appears first), I’ve done that,…
-
1
votes1
answer106
viewsSorting the contents of an Array
I have the following Array with the relevant data applied: Card Number Month (Validity or Maturity) Year I get this data from a API but in a "disorganized" way. I would like to treat these values to…
-
0
votes3
answers2325
viewsOrder By - Leave specific record for first
Store_Name | Sales | Date America | 1500 | 05-Jan-1999 Boston | 700 | 08-Jan-1999 Canada | 300 | 08-Jan-1999 Dinamarca | 250 | 07-Jan-1999 I have this table, I’d like to sort in a way where Boston…
-
0
votes1
answer561
viewsSorting method of a name array
I am trying to sort an array of names with this method, more when it has minuscule letter and Acentuo the names go to the end of the list, someone knows a method that sorts considering capital…
-
0
votes1
answer4021
viewsRead a TXT file, sort, and save a new Java file
I’m doing a job for college, and I’m not being able to read the file and throw the dice into a Arraylist to sort the data, below follows as is my code so far public class Teste { /** * @param args…
-
0
votes0
answers888
viewsWhat is the best way to show the External Quicksort simulation
I have to make one External quickSort simulator, showing for example the step by step of the same. Showing modifications to variables lower bound, upper bound, the main vector, the area vector(would…
-
0
votes2
answers1770
viewsSort a struct
Do you have any way of ordering a struct in the form: struct cidadecoord { char cidade[90]; int coordx, coordy; }cidades[N]; N is worth 30 in the case, and I would like to order x and y coordinates,…
-
0
votes1
answer592
viewsOperations with Hashmap
Good afternoon guys, I need to do some operations using Hashmap. I am new in the area. I have the following map protected Map<String, Map<String, Integer>> elementos = new…
-
0
votes2
answers1648
viewsBubble Sort matrix, bi dimensional vector
I’m having trouble creating a Bubble Sort order a square matrix. Simple vector I get, the problem eh with matrix. I tested several ways and nothing. At the moment I am in the following…
-
0
votes1
answer24
viewsSort articles via link
wordpress has a system where you sort how many files should appear on the home page, Categories etc. It would be possible to sort the amount of files through the browser link? Here we have a part of…
-
0
votes1
answer1191
viewsSort a double array (array) based on the chosen column
I have a multidimensional matrix in Delphi with 3 lines and 2 columns, I wanted a way to sort (Sort) it based on a column, follow the example: procedure; var Matriz: array of array of Double; begin…
-
0
votes1
answer535
viewsListview in numeric order - Android
In my project, I have to leave an option for the user if he wants to view the list by mileage order or by price. In my case, I’m filling out this list for a ArrayAdpter, through a class to inflate…
-
0
votes2
answers571
viewsSort array in Rails
I cannot sort my array in descending id order. <%@vendas = Vendas.find(:all,:order=>"id, DESC")%>
-
0
votes1
answer271
viewsQuery sorting - sql server
I need to sort my query so that the column "Centername" is in accordance with the logic applied in the column "All levels" someone could help me please? WITH CentroNiveis AS ( SELECT cen.Id,…
-
0
votes1
answer165
viewsSort Datetimefield by date only
I wanted to order DateTimeField by date only, ignoring the time. Because in my ordination I need to Person.objects.order_by('-date_joined', 'full_name') But sorting by name has no effect because the…
-
0
votes1
answer180
viewsSep::Sort Cakephp array
I need to sort an array in cakephp according to the order passed by parameter. The code that makes the ordering would be this: //Realizar a ordenação de acordo com o que receber do formulário no…
-
0
votes1
answer365
viewsInsertion Sort (Sorting by insertion)
Could someone give me examples of everyday life in which the method of ordering by insertion is used? Note: Without being ordering cards
-
0
votes1
answer444
viewssort the dates in the bank
I’m having the following problem, I can’t sort in ascending order the dates that are saved in the bank, I’m using order by no select but just sort the first two houses until I get to / causing the…
-
0
votes1
answer344
viewsIs there any way to define a random order by an established order?
If the title of my question was confused, I explain: I want to sort a result of a certain query of MYSQL. Example: SELECT * FROM usuarios ORDER BY cidade = 'BH' DESC, cargo = 'Programador' DESC…
-
0
votes0
answers188
viewsPass data from a list of a sheet 1 to another list of sheet 2 being ordered by the largest to smallest of a numerical column
In sheet 1 I have an occurrence list that has several columns of C to AI, I’m looking forward to going over the data from this column list C6:C25 and AI6:AI25 for spreadsheet 2, for columns D6:D25…