Lecture overview -- Keyboard shortcut: 'u'  Previous page: Sample use of class <b><kbd>List<T></kbd></b> -- Keyboard shortcut: 'p'  Next page: Sample use of Sort in <b><kbd>List<T></kbd></b> -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 14 : 36
Object-oriented Programming in C#
Collection Classes
Sample use of the Find operations in List<T>

An illustration of Find, FindAll and IndexOf

Linear search

/user/normark/oop-csharp-1/sources/c-sharp/collections/list/2/Point.csStruct Point - used as actual List type parameter.


/user/normark/oop-csharp-1/sources/c-sharp/collections/list/2/prog.csSample uses of List.Find. This program is explained


/user/normark/oop-csharp-1/sources/c-sharp/collections/list/2/outputOutput from the Find program.


  • Lessons learned

    • Use of an anonymous delegate together with Find is very useful

    • Find, FindLast, and FindAll return elements from the list (not indexes)