python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Time complexity of calculating the final digit sum of a number
I want to calculate the time complexity of calculating the "final" digit sum of a number n: sum of the digits until I get A single digit number.
I know that in the first iteration an algorit...
Daniel
Votes: 0
Answers: 1
Time complexity of nested loop with multiplication?
I just confused about to find out time complexity of the this nested loop:
for (int i=0; i<n; i++){
i*=2;
for (int j=0; j<i; j++){
}
}
And also what is the time complexity of the ou...
monstereo
Votes: 0
Answers: 1
Time/space complexity of string splitting/object creation in c++
I'am struggling to figure out the time complexity of a piece of code that I have that takes a user input from 1 line e.g open 1 0, and splits the input via spaces, then allows the user to create a new...
patricebailey1998
Votes: 0
Answers: 2
Time complexity of finding a key by value in Javascript
I know that looking up a hash value by key is O(1) (constant time) but is it the same if you find the key that has a certain value? I'm looking up the key using:
const answer = Object.keys(dict).find...
xeroshogun
Votes: 0
Answers: 1