big-o
What are the most common data structures and the Big O for operations on them?
I am trying to get a grasp on Big O notations.It seems pretty abstract.I selected the most common data structures - array, hash, linkedl list (single and double) and a binary search tree and guessed s[详细]
2023-04-13 07:55 分类:问答Big O Notation Arrays vs. Linked List insertions
Big O Notation Arrays vs. Linked List insertions: According to academic literature for arrays it is constant O(1) and for Linked Lists it is linear O(n).[详细]
2023-04-13 06:16 分类:问答Computing Time T(n) and Big-O with an infinite loop
I\'m confused on how to create a function T(n) to measure computing time for a nested infinite loop.Here is the code:[详细]
2023-04-12 21:30 分类:问答What is the Best Complexity of a Greedy Algorithm?
It seems like the best complexity would be linear O(n). Doesn\'t matter the case really, I\'m speaking of greedy algorithms in general.[详细]
2023-04-12 01:10 分类:问答Data structure that supports the following in O(1) time: initialization, insertion, deletion, finding an element, deleting all elements
Interview Question: Propose a data structure that holds elements from 0 to n − 1 and supports all of the following operations in O(1) time: initialization, insertion of an element, deletion[详细]
2023-04-10 07:00 分类:问答Proving various runtimes have various big-O complexities?
How can I prove the following: 10 n log n ∈ O(2n2) n log n + 40 · 2n - 6n ∈ O(2n) In the first one, I\'m using this math:[详细]
2023-04-08 16:48 分类:问答Why is the complexity of computing the Fibonacci series 2^n and not n^2?
I am trying to find complexity of Fibonacci series using a recursion tree and concluded height of tree = O(n) worst case, cost of each level = cn, hence complexity = n*n=n^2[详细]
2023-04-08 02:30 分类:问答What are some good resources for learning algorithm optimization?
I\'ve been tinkering around with code (Basic, Python, C++, PHP, JavaScript) on and off for almost two decades, but have only recently begun to开发者_StackOverflow get more \"serious\" about it (using[详细]
2023-04-07 19:59 分类:问答If you have equals/hashcode based on int, what's the optimal way to match a "full" object from another collection?
Say you had this DTO class: public class MyObj{ private int id; private String displayName; private String backendData;[详细]
2023-04-07 12:25 分类:问答Big Omega Notation. Am I doing this right?
If I have some algorithm that runs at best n time and at worst n^2 time, is it fair to say that the algorithm is Big Omega (n)?[详细]
2023-04-07 02:13 分类:问答