Questions tagged as 'comparaciones'

2
answers

Sort arraylist by two parameters

I have java a class Mensaje with the attributes: String Tipo int Orden String Contenido In a ArrayList I add several instances of this class The problem arises when I have to order it in such a way that I stay above sorted...
asked by 27.03.2018 / 16:00
1
answer

Get the number of different characters of a C text [duplicated]

I need to make a program in C , in which a word is entered and the number of different characters of a text char[] returns. Example: "holahola" only 4 different characters were used. If there is at least one space, it must be ta...
asked by 19.03.2017 / 01:18
1
answer

Sort and replace positions in bd mysql

I have a table with these values Juan 5 Pedro 7 Luis 6 I want to replace the consecutive numbers that are listed from least to largest starting from number 1 ie a php script that detects that the table does not have the number 1 the...
asked by 05.04.2017 / 13:29
1
answer

Get names of a text file and compare your initials

I'm trying to compare the initials of some names previously obtained from a text file, the format of the file would be this: nombre dato1 dato2 nombre dato1 dato2 nombre dato1 dato2 nombre dato1 dato2 I ask the user to type the name of the...
asked by 12.12.2018 / 17:05
3
answers

Check equality of two ArrayList

I have two ArrayList objects (using Java), each object with several attributes of different type. I would like to know if these two ArrayList contain the same objects (neither more nor less), with the same values. The order is indifferent. I...
asked by 18.04.2017 / 09:14
1
answer

Comparator and Comparable Interfaces. Java

My question is: Is it strictly necessary that when using Comparable we implement the interface on the class itself in which we want to establish the comparison and sort criteria for when we invoke sort () using compareTo ()? Or could I create...
asked by 02.02.2018 / 18:08
3
answers

Identify an anagram

I'm doing an exercise and I need to identify an anagram. More or less I have it, but it fails me, because I do not correctly identify the capitals of the lowercase letters and this I do not know very well how to do it. I have defined a method...
asked by 29.12.2016 / 15:42
1
answer

Compare two PHP objects

I have a problem, I am currently trying to compare two objects, one object is cash sales and the other is card sales.    Cash sales [ { "ventas": 1, "dia": 7, "total": 120 }, { "ventas": 1, "dia": 8, "total":...
asked by 08.09.2018 / 18:49
1
answer

Regarding the sentence "compareTo"

I have a question about the compareTo statement. If I have: if(x.compareTo(y)==0) I understand that I am asking if the value of x is equal to and . But if I want to ask if they are different? Should I place a denial forward? if(!(...
asked by 12.06.2018 / 20:06
1
answer

How to compare two arrays with text strings and create a new one from repeated words in these

I have two arrays, one with a text with more words and the other with the text that I should compare, the problem is that there is a word that appears twice in each array so when I run the code it repeats itself in the new array, when it should...
asked by 17.04.2018 / 19:56