The time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the size of the input to the problem.
I can see how, when looking up a value in a BST we leave half the tree everytime we compare …
data-structures time-complexity big-o binary-search-treeThis question was asked in the Google programming interview. I thought of two approaches for the same: Find all the …
arrays algorithm time-complexity dynamic-programming subsequenceFirst, here's my Shell sort code (using Java): public char[] shellSort(char[] chars) { int n = chars.length; int increment = n / 2; …
algorithm big-o time-complexity shellsortWhy is the time complexity of node deletion in doubly linked lists (O(1)) faster than node deletion in singly linked …
linked-list complexity-theory time-complexity singly-linked-list doubly-linked-listAs the title says, I was wondering what the time complexity of the contains() method of an ArrayList is.
java arraylist time-complexityProve that 1 + 1/2 + 1/3 + ... + 1/n is O(log n). Assume n = 2^k I put the series into the summation, but I have …
time-complexity big-o complexity-theoryFor String A = "abcd" then answer should be {a,ab,abc,abcd,b,bc,bcd,c,cd,d} To find …
java algorithm performance substring time-complexityCan someone give me example of an algorithm that has square root(n) time complexity. What does square root time …
time-complexityWhile I was learning Binary search tree(Balanced and unbalanced), I come up with questions which I need to resolve: …
algorithm data-structures binary-search-tree time-complexity avl-treeIs there any algorithm to compute the nth fibonacci number in sub linear time?
performance algorithm math time-complexity fibonacci