time-complexity
I have a non-performant method, how can I improve its efficiency?
I have a simple m开发者_运维百科ethod to compare an array of FileInfo objects against a list of filenames to check what files have been already been processed. The unprocessed list is then returned.[详细]
2023-01-23 06:29 分类:问答Exhaustive searches vs sorting followed by binary search
This is a direct quote from the textbook, Invitation to Computer Science by G. Michael Scneider and Judith L. Gersting.[详细]
2023-01-21 16:26 分类:问答How can one test time complexity "experimentally"?
Could it be done by keeping a counter to see how many iterations an algorithm goes through, or doe开发者_运维百科s the time duration need to be recorded?The currently accepted won\'t give you any theo[详细]
2023-01-21 04:23 分类:问答Can someone help solve this recurrence relation? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.[详细]
2023-01-20 04:09 分类:问答Big-O Notation Code Algorithm Analysis Homework
for(int i=N; i>0; i=i/2) irrelevant statement; I am asked to find the complexity class and I am unsure of whether I am supposed to use Big开发者_JAVA技巧-Omega notation or Big-O? But I am assumin[详细]
2023-01-20 03:00 分类:问答Multiplying (nesting) two big Os
If a function A calls n^c funct开发者_运维百科ions B that runs in O(n^2) time, what is the time complexity of function A? Is it just polynomial (n^c) as well as c has just gotten bigger?If a function[详细]
2023-01-19 23:21 分类:问答Determining the time complexities of worst case algorithms
Do the two algorithms have the same theta characterization of Θ(n^2)? int sum = 0; for (int i = 0; i < n; i++ )[详细]
2023-01-18 04:17 分类:问答Integer time complexity in Haskell
I had an assignment in school last week to implement a function for calculating the n:th number in the fibonacci sequence. A \'sub-assignment\' was to implement it using accumulation(Might not be a co[详细]
2023-01-17 10:51 分类:问答Get the middle of an Ix range in O(1) time in Haskell
I was playing around with this code kata in Haskell, and I came across the question in the topic. It\'s trivial to find the midpoint of an array whose indexes are a single numerical value, but Haskel[详细]
2023-01-15 13:00 分类:问答Can we compute this in less than O(n*n) ...( nlogn or n)
This is a question asked to me by a very very famous MNC. The question is as follows ... Input an 2D N*N array of 0\'s and 1\'s. If A(i,j) = 1, then all the values correspondingto the ith row and the[详细]
2023-01-14 22:58 分类:问答