I need to implement a data structure that supports insertion deletion and search in O(log(n)) and extracting a special object in O(1).
Hello it has been some time sins i have used Big O notation, so i\'m a bit rusty. I know that having 1 loop, that loops n times is O(n), and having 1 loop that loops n time within another loop that l
Bellow is some Java code for the question: int total1 = 0; 开发者_开发百科int total2 = 0; for (int x = 0; x <= n; x++)
How do you know if a algorithm function takes linear/constant/logarithmic time for a specific operation? does it depend on 开发者_JAVA百科the cpu cycles?There are three ways you can do it (at least).
for i := 1 to n do j := 2; while j < i do j := j^4; I\'m really confused when it comes to Big-O notation, so I\'d like to know if it\'s O(n log n). That\'s my gut, but I can\'t prove it. I know t
I am reading thee book "Discrete Mathematics and its Application" by Kenneth H. Rosen I am now in the chapter Growth of Functions and trying the Exercise of that.[5th Edition page 142]
I\'m making a simple RTS game. I want it to run very fast because it should work with thousands of units and 8 players.
I\'m confused about the complexity of the following (the operation performed inside the inner loop is in constant time):
I\'m having a hard time understanding the following statements from Algorithms by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani - page 24 that they represent the sum of O(n) as O(n2). But my unde
I\'m confused about how to do big-O analysis for the following problem - find an element from an array of integers. ( an example problem)