tagged [big-o]

Big-O summary for Java Collections Framework implementations?

Big-O summary for Java Collections Framework implementations? I may be teaching a "Java crash-course" soon. While it is probably safe to assume that the audience members will know Big-O notation, it i...

20 Feb at 05:1

What does "O(1) access time" mean?

What does "O(1) access time" mean? I have seen this term "O(1) access time" used to mean "quickly" but I don't understand what it means. The other term that I see with it in the same context is "O(n) ...

23 May at 12:2

How can building a heap be O(n) time complexity?

How can building a heap be O(n) time complexity? Can someone help explain how can building a heap be complexity? Inserting an item into a heap is , and the insert is repeated n/2 times (the remainder ...

Time complexity of Math.Sqrt()?

Time complexity of Math.Sqrt()? How can I find the complexity of this function? ``` private double EuclideanDistance(MFCC.MFCCFrame vec1, MFCC.MFCCFrame vec2) { double Distance = 0.0; for (int K = 0...

3 Jan at 18:52

Is this technically an O(1) algorithm for "Hello World"?

Is this technically an O(1) algorithm for "Hello World"? Would this be classified as an O(1) algorithm for "Hello, World!" ?? ``` public class Hello1 { public static void Main() { DateTime Twenty...

2 Dec at 17:10

Which is better: O(n log n) or O(n^2)

Which is better: O(n log n) or O(n^2) Okay so I have this project I have to do, but I just don't understand it. The thing is, I have 2 algorithms. and . Anyway, I find out in the project info that if ...

How to merge two sorted arrays into a sorted array?

How to merge two sorted arrays into a sorted array? This was asked of me in an interview and this is the solution I provided: ``` public static int[] merge(int[] a, int[] b) { int[] answer = new int...

16 Apr at 22:53

C# List remove from end, really O(n)?

C# List remove from end, really O(n)? I've read a couple of articles stating that List.RemoveAt() is in O(n) time. If I do something like: Removing from the end of the list should be O(1), as it just ...

22 Mar at 18:45

.NET Framework Time complexity in the documentation

.NET Framework Time complexity in the documentation Where can I find the time complexity for methods in the standard .Net library? I use MSDN and it occasionally mentions time complexity, but not oft...

15 Jun at 12:49

Is there any method for multiplying matrices having O(n) complexity?

Is there any method for multiplying matrices having O(n) complexity? I want to multiply two matrices but the triple loop has O(n) complexity. Is there any algorithm in dynamic programming to multiply ...

17 Jan at 07:7