Questions tagged [processing-efficiency]
622 questions
-3
votes
1 answer
Logic Math Puzzle - Help me solving this - C++
I have following C++ array: int arr[20][20] filled with numbers from 1 to 5
A specific element, for example arr[5][8] is set as start point
I have to find all elements in the array, that have the same value and that are "touching" (vert/horiz) the…

westernCiv
- 29
- 7
-3
votes
1 answer
Should I create Edittexts when custom dialogBox is created or before onCreate? Which is more efficient?
I have an Android app in which I create a custom dialogBox which is built from an XML file. The custom dialogBox contains 10 different edittext box's. My question is, in my MainActivity.java code, should I create these edittext's when my code…

Paul Alexander
- 2,686
- 4
- 33
- 69
-6
votes
1 answer
How to (efficiently) get the start, end, and count of timeseries data from all SQL tables?
I have a massive amount of SQL tables (50,000+) each with 100,000+ time series data points. I'm just looking for the most efficient way to get the start, end, and count of each table.
I've tried the following in a loop, but its very slow, I time out…

James Gessel
- 29
- 4
-6
votes
2 answers
Static class variable vs function variable. Is one more efficient?
I'm a bit obsessive about efficiency, but I've never been able to find a definitive answer to this question. Is one of these more efficient / better than the other, and if so why?
Static class variable used in non-static function:
public class…

Andrew Smith
- 2,589
- 3
- 19
- 17
-7
votes
1 answer
Prove an algorithm which takes (n+1)^5 steps is O(n^5)?
Find out the c and n0.
Please explain with the steps.

Venkatesh K
- 4,364
- 4
- 18
- 26
-9
votes
1 answer
Is doing multiplication multiple times or assigning to a variable faster?
Let's say I have this code:
foo = int(input("Number"))
bar = int(input("Number"))
for number in range(0, 10):
if foo*bar > 0:
print("hello")
But, I could also have this code:
foo = int(input("Number"))
bar = int(input("Number"))
top =…

Quelklef
- 1,999
- 2
- 22
- 37