Top "List" questions

The list tag may refer to: a linked list (an ordered set of nodes, each referencing its successor), or a form of dynamic array.

how to check if object already exists in a list

I have a list List<MyObject> myList and I am adding items to a list and I want …

c# linq list
Find an element in a list of tuples

I have a list 'a' a= [(1,2),(1,4),(3,5),(5,7)] I need to find all the tuples for a particular number. say for 1 it …

python list search tuples
How to find all positions of the maximum value in a list?

I have a list: a = [32, 37, 28, 30, 37, 25, 27, 24, 35, 55, 23, 31, 55, 21, 40, 18, 50, 35, 41, 49, 37, 19, 40, 41, 31] max element is 55 (two elements on position 9 and 12) I need to find on which position(…

python list max
How to split() a delimited string to a List<String>

I had this code: String[] lineElements; . . . try { using (StreamReader sr = new StreamReader("TestFile.txt")) { String line; while ((line = sr.ReadLine()) != …

c# .net list arraylist
Different ways of clearing lists

Is there any reason to do anything more complicated than one of these two lines when you want to clear …

python list
Quickest way to compare two generic lists for differences

What is the quickest (and least resource intensive) to compare two massive (>50.000 items) and as a result have two …

c# linq list
Python data structure sort list alphabetically

I am a bit confused regarding data structure in python; (),[], and {}. I am trying to sort a simple list, probably …

python list sorting alphabetical
C# list.Orderby descending

I would like to receive a list sorted by 'Product.Name' in descending order. Similar to the function below which …

c# list sorting sql-order-by
Determine if string is in list in JavaScript

In SQL we can see if a string is in a list like so: Column IN ('a', 'b', 'c') What's …

javascript string list
Standard deviation of a list

I want to find mean and standard deviation of 1st, 2nd,... digits of several (Z) lists. For example, I have …

python list standard-deviation