大约有 10,151 项符合查询结果(耗时:0.0249秒) [XML]
Designing function f(f(n)) == -n
A question I got on my last interview:
118 Answers
118
...
Schema for a multilanguage database
I'm developing a multilanguage software. As far as the application code goes, localizability is not an issue. We can use language specific resources and have all kinds of tools that work well with them.
...
How can building a heap be O(n) time complexity?
Can someone help explain how can building a heap be O(n) complexity?
17 Answers
17
...
How to calculate moving average using NumPy?
There seems to be no function that simply calculates the moving average on numpy/scipy, leading to convoluted solutions .
...
What is the most efficient way of finding all the factors of a number in Python?
Can someone explain to me an efficient way of finding all the factors of a number in Python (2.7)?
22 Answers
...
How to create the most compact mapping n → isprime(n) up to a limit N?
Naturally, for bool isprime(number) there would be a data structure I could query.
I define the best algorithm , to be the algorithm that produces a data structure with lowest memory consumption for the range (1, N], where N is a constant.
Just an example of what I am looking for: I could rep...
how to calculate binary search complexity
I heard somebody say that since binary search halves the input required to search hence it is log(n) algorithm. Since I am not from a mathematics background I am not able to relate to it. Can somebody explain it in a little more detail? does it have to do something with the logarithmic series?
...
Memoization in Haskell?
Any pointers on how to solve efficiently the following function in Haskell, for large numbers (n > 108)
8 Answers
...
How can I remove a trailing newline?
What is the Python equivalent of Perl's chomp function, which removes the last character of a string if it is a newline?
...
What is a plain English explanation of “Big O” notation?
I'd prefer as little formal definition as possible and simple mathematics.
41 Answers
...