so i have a list where i need to add new values constantly but when i do i need to increment it and insert it in between two values.
List initiali
Another approach, if there is a computationally viable way of sorting the elements, is:
list.Insert(num); // ... list.Insert(otherNum); // Sorting function. Let's sort by absolute value list.Sort((x, y) => return Math.Abs(x) - Math.Abs(y));