Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
What is the time complexity of the method String.GetHashCode()? For example, if hashed string of length n, by mod 2 using Horner's scheme it's O(n).
What is Big O for GetHashCode?
According to the reference source the time complexity is O(n). It basically just takes each character of the string and adds its value to the hash.
As mentioned in Peter Ritchie's comment the algorithm can be changed by using the <UseRandomizedStringHashAlgorithm> element.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 months ago.
Improve this question
How to invert logic on recursive calls?
I have this solve that counts the number of recursive calls. It's working properly. But how can I invert the logic to count number
In C# you can simply invert a statement using ! so it would be != instead of ==
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Is a List in C# equal to that of an ArrayList in terms of time complexity?
As it is my understanding that they're both similar in how they function, being dynamic arrays?
Both ArrayList and List<T> have the same basic implementation, using an array to store the items, reallocating as necessary when items are added. Indeed, much of List<T> is simply copy/paste from ArrayList, with appropriate changes to support the generics.
While there may be small differences in actual performance, the "big-O" complexity of operations in each would be the same.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have two records in my view in SQL
Now I have to show one record in my grid in which ledgername xxx xxx(1685) has minimum time in TimeIn and maximum time in TimeOut I have the following things..
With your brief question I will give a couple of pointers: GroupBy, Select, Min, Max
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to compare two strings on percentage basis
like i have this
Player and wmplayer
Manager and IDMan
Mail and WINMail
Explorer and iexplorer
Any Help Please
You can probably make use of a library such as ScoreSharp. It is designed to do fuzzy matching to find similarities between strings.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Usernames Yes/No
“6789” Yes
“33333333_TL” No
“34567890-Shhh” No
“123456-Hero” Yes
“1234567” Yes
“New12345678” No
“87456773kk” No
“1234567890” No
See Regex to check for 4 consecutive numbers.
First check if your string's length >= 8 and then use a regex to look for N consecutive digits and if it finds a fit - your validation fails. Something like - /[^\d]\d{8}[^\d]/