Efficient Search

Hi, we need a data structure in kernel function so that when we loop through an array of STRUCT for the first time, we can put each STRUCT’s index into the data structure if a condition is satisfied.

When we loop through the array the second time, we need to check whether or not the STRUCT’s index exists in the data structure already. if it is, we just simply ingonre the STRUCT and go to the next.

What will be the best option for this data structure?

Thanks

Hi, we need a data structure in kernel function so that when we loop through an array of STRUCT for the first time, we can put each STRUCT’s index into the data structure if a condition is satisfied.

When we loop through the array the second time, we need to check whether or not the STRUCT’s index exists in the data structure already. if it is, we just simply ingonre the STRUCT and go to the next.

What will be the best option for this data structure?

Thanks