complexity

Relationships between complexity theory and software engineering?

I'm interested to know if there is any literature out there on the relationship of complexity theory (emergence, complex systems, evolution) and software development processes. I read somewhere that SCRUM philosophy came out of the theory of punctuated equilibrium in evolution theory. Are there any additional studies/researches on this s...

Worst case time complexity

Hi, i have an algorithm that searches into a directory and search for all the text files in that directory and any sub-directory. Assuming i do not know how many sub-directories and sub-sub directories there are in the parent directory. how do i calculate the complexity? this is the code i am using public List<string> GetFilesInDirec...

upper bound, lower bound

What does it mean to prove an upper bound or lower bound to an algorithm? ...

Algorithm complexity

Hi i am trying to calculate the complexity of the following algorithm private static List<int> GetIndexes(string strippedText, string searchText) { List<int> count = new List<int>(); int index = 0; while (strippedText.Length >= index && index != -1) { index = strippedText.IndexOf(searchTex...

What's the time complexity of getting an element in an array in PHP?

I've little idea of how arrays are implemented in PHP, and know that for most OOP languages the complexity is one of constant time, O(1), for an array of a predefined type. So what's the deal in PHP with it's dynamic typing, extending arrays, etc.? ...

What is the time complexity of java.util.HashMap class' keySet() method?

I am trying to implement a plane sweep algorithm and for this I need to know the complexity of java.util.HashMap class' keyset() method. What i feel, it would be O(n log n). Am I correct? **Edit I am talking about the time complexity of the method keySet(), the walking over will take surely O(n) time. But I am not sure, how it retrieves...

NP vs NP-Complete vs NP-Hard

What are the differences between NP vs NP-Complete vs NP-Hard ? I am aware of many resources all over the web. I d like to read your explanations, and the reason is they might be different then what s out there, or it s out there and i m not aware. ...

What is the complexity of matrix addition?

I have found some mentions in another question of matrix addition being a quadratic operation. But I think it is linear. If I double the size of a matrix, I need to calculate double the additions, not quadruple. The main diverging point seems to be what is the size of the problem. To me, it's the number of elements in the matrix. Other...

Advanced/Non common Efficient Sorting Algorithms

I know there are some like: Bubble sort Insertion sort Shell sort Merge sort Heapsort Quicksort Bucket sort Radix sort Distribution sort Shuffle sort And there are some impractical ones like: Bogosort RandomSort Some of the above use comparisons and others do not. Do you know which other Efficient Algorithms or Techniques ...

Why the time complexity in dll is faster than deletion of a node in sll?

Why the time complexity in doubly linked list which is O(1) is faster than deletion of a node in singly linked list which is O(n)? ...

Time complexity of accessing a Python dict

Hello, I am writing a simple Python program. My program seems to suffer from linear access to dictionaries, its run-time grows exponentially even though the algorithm is quadratic. I use a dictionary to memoize values. That seems to be a bottleneck. The values I'm hashing are tuples of points. Each point is: (x,y), 0 <= x,y <= 50 ...

What are the differences between O(1) and O(2) in algorithm-analysis?

According to the definition of big O f(n) <= C*g(n)(which means f(n) = O(g(n)), it could be deduced that: f(n) <= C f(n) <= 2C I think there are no big differences between these two. What I could come up with is: f(n) = 1 - 1 / n f(n) = 2 - 1 / n C = 1 But what differs this two complexities,since both are constant complexity? Cou...

What is the execution time T(n) of the algorithms?

Happy new year and peace to you all! Can you please explain to me what is the execution time T(n) of the 2 algorithms? Assuming execution time T(n) = # executions of (a:=a+1) Algorithm 1: for i ← 1 to n do for j ← 1 to i do for k ← j to i+j do a ← a + 1 end for end for end for Algorithm 2: ...

What is the Average Big-Ο complexity of Gnome sort?

There is nothing about it in wikipedia. Anyone knows that? I only want to know the average Big-O Complexity of that algorithm. ...

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

This is a homework question. I'm not expecting an answer, just some guidance, possibly :) 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 the lower bound with (n/2)(n/2). This does not seem all that intuitive to me. Why would that be the case? I can definitely see how to...

Question about NP-Completeness of the Independent Set Problem.

I thought that, when proving that a problem P is NP-Complete, we were supposed to reduce a known NPC problem to P. But, looking at the solution to the Independent Set problem, it seems to not go this way. To prove that Independent Set is NP-Complete, you take a graph G, find its inverse G', and then compute CLIQUE(G'). But, this is doin...

How does a non deterministic turing machine work?

I understand they aren't real and they seem to branch computation whenever there are 2 options, instead of picking one. But, for example, if I say this: "Non deterministically guess a bijection p of vertices from Graph G to Graph H" (context here is Graph Isomorphism) What is that supposed to mean? I understand the bijection, but it sa...

What are the useful limits of Linear Bounded Automata compared to Turing Machines?

There are languages that a Turing machine can handle that an LBA can't, but are there any useful, practical problems that LBAs can't solve but TMs can? An LBA is just a Turing machine with a finite tape, and actual computers have finite storage, so it would seem to me that there's nothing of practical importance that an LBA can't do. E...

Techniques to Reduce Complexity in Game Programming

In my spare time I program games as a hobby, different sorts of things and currently nothing very complex. Things likes 2d shooters, Tile-Based games, Puzzle Games, etc... However as the development of these games goes on I find it becomes hard to manage the complexity of different subsystems within the games, things like Interface, Wo...

What complexity are operations on Java 7's BigInteger?

What complexity are the methods multiply, divide and pow in BigInteger currently? There is no mention of the computational complexity in the documentation (nor anywhere else). ...