Given that strings are immutable in .NET, I'm wondering why they have been designed such that string.Substring() takes O( substring.Length ) time, instead of O(1)?
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Showing posts with label time-complexity. Show all posts
Showing posts with label time-complexity. Show all posts
Friday, May 18, 2012
If strings are immutable in .NET, then why does Substring take O(n) time?
Subscribe to:
Posts (Atom)