C# Language & .NET Platform 12th Lecture Pavel Ježek pavel.jezek@d3s.mff.cuni.cz Some of the slides are based on University of Linz .NET presentations. © University of Linz, Institute for System Software, 2004 published under the Microsoft Curriculum License (http://www.msdnaa.net/curriculum/license_curriculum.aspx)
CLI Type System All types Value types Reference types Pointers (allocated in-place [with exceptions]) Reference types (allocated on managed heap) Pointers Structures Enumerations Classes (e.g. strings) Interfaces Arrays Delegates Simple types (Int32, Int64, Double, Boolean, Char, …) Nullables User defined structures
How Would You Implement List<T>.Clear()? Option Complexity with Respect to Number of Elements in List (n) A O(1) B O(n) C Something else.
How Would You Implement List<T>.Clear()? Option Complexity with Respect to Number of Elements in List (n) A O(1) B O(n) – set all elements to null! Mind the GC! C Something else.
What about String.Substring?