-3

I have the following problem I would like to tackle. I have a list of elements 'Ei' (element i), each with several parameters. The parameters are similar and each is assigned with a weight 'Wx' (Weight for parameter x).

The weight can be changed according to preference. I need to rank/prioritize the elements according to the parameters and their weights.

Are you familiar with any approach/technique/solution for a similar system?

Thanks

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Boris Ka
  • 79
  • 1
  • 1
  • 8
  • This question is too vague and too broad. Just how and when are the weights changed according to preference--before building the structure of elements, during, after? How frequently is this change made in the lifetime of the structure? Is the structure built all at once or incrementally? Can elements be deleted? What is the maximum size of the structure? And so on. There are *many* structures that can do what you say but the efficiency varies wildly, depending on the answers to those questions. Please show a specific example with a code attempt on your part. – Rory Daulton Aug 09 '18 at 12:51

1 Answers1

0

Are you storing those elements in a Colletions-type structure? If so, you can use sorting by weight, making so the element with the most weight stays at the top. Search for sorting algorithms.

Mateus Wolkmer
  • 706
  • 4
  • 26