## 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

## Is log(n!) = Θ(n·log(n))?

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

## What’s “P=NP?”, and why is it such a famous question? [closed]

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?

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

## Computational complexity of Fibonacci Sequence

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

## Determining complexity for recursive functions (Big O notation)

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

## Cost of len() function

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

## Constant Amortized Time

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

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

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

## Big O, how do you calculate/approximate it?

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