lists (1,872)


Python: what is the difference between(1,2,3) and[1,2,3], and when should I use each?

Python: what is the difference between(1,2,3) and[1,2,3], and when should I use each?

In many places,(1,2,3) and[1,2,3] can be used interchangeably. When should I use one or the other, and why?…


algorithm - Merge Sort a Linked List

I was recently brushing up on some fundamentals and found merge sorting a linked list to be a pretty good challenge. If you have a good implementation then show it off here.…



How Best to Compare Two Collections in Java and Act on Them?

I have two collections of the same object, Collection<Foo> oldSet and Collection<Foo> newSet. The required logic is as follow: if foo is in(*) oldSet but not newSet, call doRemove(foo) else if foo…


.Net 2.0-How efficient are Generic Lists?

I'm creating an app that holds loads of loads of user data in memory, and it's mostly keeping it all in List<T> structures(and some Dictionary<T,T> when I need lookup). And I'm wondering... How effi…


What's the best way to return multiple values from a function in Python?

I have a function where I need to do something to a string. I need the function to return a boolean indicating whether or not the operation succeeded, and I also need to return the modified string.…


Fastest way to find common items across multiple lists in C#

Given the following: List<List<Option>> optionLists; what would be a quick way to determine the subset of Option objects that appear in all N lists? Equality is determined through some string propert…


c# - Is there a built-in method to compare collections?

I would like to compare the contents of a couple of collections in my Equals method. I have a Dictionary and an IList. Is there a built-in method to do this? Edited: I want to compare two Dictionari…


.net - Comparing two collections for equality irrespective of the order of items in them

I would like to compare two collections(in C#), but I'm not sure of the best way to implement this efficiently. I've read the other thread about Enumerable.SequenceEqual, but it's not exactly what I'…


Any better way to create MediaWiki numbered lists?

When using MediaWiki's markup language, the only thing that I hate is creating numbered lists. The only way I know to create a list is to do something like this:#Item1#Item2 However, if I want to…


Auto number column in SharePoint list

In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?…




list python two how from multiple java elements array and