Live data from Hacker News

Timecomplexity.ai: GPT-3.5-Turbo Powered Big O Runtime Calculator

timecomplexity.ai

1–3 of 3 posts

Re: Timecomplexity.ai: GPT-3.5-Turbo Powered Big O Runtime Calculator

#2
Very easily tricked. See e.g. this wrong factorial implementation:

int fun(int n){

if (n==1 || n==2){

  return 1;
}else{

  return fun(1) + fun(n-2);
}

}

"The function recursively calls itself twice, with n-2 and 1 as arguments. This creates a binary tree with a depth of n, and each node has two children. Therefore, the total number of nodes in the tree is 2^n. Since each node represents a function call, the time complexity is O(2^n)."

Re: Timecomplexity.ai: GPT-3.5-Turbo Powered Big O Runtime Calculator

#3

Very easily tricked. See e.g. this wrong factorial implementation: int fun(int n){ if (n==1 || n==2){ return 1; }else{ return fun(1) + fun(n-2); } } "The function recursively calls itself twice, with n-2 and 1 as arguments. This creates a binary tree with a depth of n, and each node has two children. Therefore, the total number of nodes in the tree is 2^n. Since each node represents a function call, the time complexi…

Yep indeed, it's really only useful for simple questions. The main use case is for the many people on Leetcode / Reddit who ask for help to analyze their code - I have found it is quite good for those types of problems. Example: https://www.reddit.com/r/leetcode/comments/12lwkhg/comment/j...