## How to find the lowest common ancestor of two nodes in any binary tree?

The Binary Tree here is may not necessarily be a Binary Search Tree. The structure could be taken as – struct node { … Read more

The Binary Tree here is may not necessarily be a Binary Search Tree. The structure could be taken as – struct node { … Read more

I am to show that log(n!) = Θ(n·log(n)). A hint was given that I should show the upper bound with nn and show … Read more

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for … Read more

Are there any O(1/n) algorithms? Or anything else which is less than O(1)? 32 Answers 32 This question isn’t as silly as it … Read more

I understand Big-O notation, but I don’t know how to calculate it for many functions. In particular, I’ve been trying to figure out … Read more

I have a Computer Science Midterm tomorrow and I need help determining the complexity of these recursive functions. I know how to solve … Read more

What is the cost of len() function for Python built-ins? (list/tuple/string/dictionary) 5 Answers 5

What is meant by “Constant Amortized Time” when talking about time complexity of an algorithm? 8 s 8 Amortised time explained in simple … Read more

Can someone help explain how can building a heap be O(n) complexity? Inserting an item into a heap is O(log n), and the … Read more

Most people with a degree in CS will certainly know what Big O stands for. It helps us to measure how well an … Read more