Given that strings are immutable in .NET, I\'m wonde开发者_StackOverflowring why they have been designed such that string.Substring() takes O(substring.Length) time, instead of O(1)?
I was going through Linear hashing article on Wiki. One line puzzled me and here it is: \" The cost of hash table expansion is spread out across each hash table insertion operation, as opposed to bei
A look-up operatio开发者_如何学Gon OR contains for single can be O(n) in worst-case right ? So, for n elements look up in hashSet will be O(n^2)?Yes, but it\'s really the worst case: if all the elemen
Consider a file containing N words with one word per line.The file is too big so whole of it connot be read in memory at one time.
What is the time complexity of the put(x) and get() functions for a Stack abstract data type that is implemented using a LinkedList?
Given this sort algorithm how do you express its time complexity? Originally presente开发者_如何转开发d here (partial archive).
I have two Stacks s1 and s2. s1 containing negative integers and s2 containing positive integers. Both Stacks have been sorted already from lowest value(at the bottom) to highest(at the top). x1 and x
A question in one of my past exams is a multi-choice question: Choose the FALSE statement: 7(log n) + 5n + n(log log n) + 3n(ln n) is
I have to write a program which create\'s an address book that can provide search functionality on multiple fields, with a large number of records. Binary search is an option but the tricky part is th
Can someone explain me when it comes to binary search we say the running tim开发者_开发技巧e complexity is O(log n)? I searched it in Google and got the below,