Let's say I have a 2-D array arr[][]: and we have to sort it based on col1 1st and then based on col2 What is the way to do this in Java? Particul ...
Let's say I have a 2-D array arr[][]: and we have to sort it based on col1 1st and then based on col2 What is the way to do this in Java? Particul ...
I was trying to figure out this exercise from a school exam. They implemented an abstract template Book class, and the assignment is to implement a bo ...
I have a set of pdf files that I'm supposed to sort in reverse semantic order. The files are: Release_Notes_CNV_22.3.pdf Release_Notes_CNV_22.9. ...
I am using C++17. std::set is a template type: One can have a std::set as a data member. For example: One can also explicitly specify the compa ...
I want to overload the left-hand operator (<) for class Node. Note that, the elements won't be the class objects it will be a pointer to them. Plea ...
I am trying to understand how to work with TreeSet with Comparator implementation. Code is below. The objects from the numbers Set should be sorted a ...
I have the next problem. There is some WPF dialog with DataGrid. This DataGrid displays some table. Table contains 1 column with a Date. This Date pro ...
I have tried to make a custom ThreadPoolExecuter that holds a PriorityBlockingQueue as his queue. I have tried to make the queue to make the PriorityB ...
In the code below the object someObj has two properties, a float x and an int pnt. An ArrayList<someObj> is created and is then sorted using a C ...
so the logic should be like first object must be {"z","pnp"} as current("z") there is no object where next is ("z"), so it should be first object af ...
I'm trying to create a generic comparator for a List<List<Comparable>> which can sort on multiple fields. The structure represents a List ...
I want to decrease the value of an element with index i in my Min Heap data structure that i am implementing using an ArrayList (and then move the ele ...
current.getValues(); returns a List of the generic T What do I have to fill in the brackets at return val.stream().min(????)? How do I get the Comp ...
I have this scenario where I have to sort listA based on the order of elements in listB. But the problem I am facing is that if there is that if list ...
Input: Output: What logic should I use in order to get minimum of function result? I have a class with function which compares 2 items (int) an ...
I currently have a TreeSet that contains elements of type Pair, and I'm sorting them by their value in descending order. Here is the link to the orig ...
I have a class Tester, where the definition is , and I am asked to implement a method to sort a list of Tester objects by the ascending order of Ta ...
I'm using Collectors.groupingBy to group may objects into list. Examples are as follows: Output: But my goal is to sort StudentDTO by score usin ...
Let's say I am building a TreeSet of an object for which the ordering depends on only one value. I cannot do because if I add two different Foo ob ...
I am making a program that sorts workers to workplaces. I have made a basic comparator (comp) that sorts on how many workers a workplace needs and it ...