complexity

Algorithm improvement on a simple looking postgresql query.

High-level: Can I do this order by, group by based on sum any faster? (PG 8.4, fwiw., on a non-tiny table .... think O(millions of rows) ) Suppose I had a table like this: Table "public.summary" Column | Type | Modifiers -------------+-------------------+-----...

I need a book where can I find a lot of reductions

Hi all, do you know a book where there are proofs of reductions between different problems? I have the papadimitriou and others but there are only a few reductions.. Thanks in advance, bye ...

Is there such a thing as "negative" big-O complexity?

Possible Duplicate: Are there any O(1/n) algorithms? This just popped in my head for no particular reason, and I suppose it's a strange question. Are there any known algorithms or problems which actually get easier or faster to solve with larger input? I'm guessing that if there are, it wouldn't be for things like mutations or...

Ways to improve efficiency of C# code

Hi all, Like most of us, I am a big fan of improving efficiency of code. So much so that I would rather choose fast-executing dirty code over something which might be more elegant or clean, but slower. Fortunately for all of us, in most cases, the faster and more efficient solutions are also the cleaner and the most elegant ones. I u...

Does Big O Measure Memory Requirments Or Just Speed?

I often here people talk about Big O which measures algorithms against each other Does this measure clock cycles or space requirements. If people want to contrast algorithms based on memory usage what measure would they use ...

Big-oh vs big-theta

Possible Duplicate: What is the difference between Θ(n) and O(n)? It seems to me like when people talk about algorithm complexity informally, they talk about big-oh. But in formal situations, I often see big-theta with the occasional big-oh thrown in. I know mathematically what the difference is between the two, but in english...

Selecting k sub-posets

I ran into the following algorithmic problem while experimenting with classification algorithms. Elements are classified into a polyhierarchy, what I understand to be a poset with a single root. I have to solve the following problem, which looks a lot like the set cover problem. I uploaded my Latex-ed problem description here. Devising...

Supporting Code Metrics with Case Studies

I'm principally interested in case studies on code metrics, relating code readability to defect reduction, that justify taking seriously cyclomatic complexity or some similar metric. Wikipedia has this example: A number of studies have investigated cyclomatic complexity's correlation to the number of defects contained in a mod...

Complexity of STL max_element

So according to the link here: http://www.cplusplus.com/reference/algorithm/max_element/ , the max_element function is O(n), apparently for all STL containers. Is this correct? Shouldn't it be O(log n) for a set (implemented as a binary tree)? On a somewhat related note, I've always used cplusplus.com for questions which are easier to a...

How to find all table references from Oracle 10G PL/SQL functions and procedures?

How to find all table references from Oracle 10G PL/SQL functions and procedures? I definitely can execute the following SQL statement: select * from dba_source where text like '%tbl_c%' but I wonder how to find all functions that call functions that refer to table used. For example I can have a function A that calls function B that...

Estimating running time for large inputs

An algorithm having worst-case running time of O(N^2) took 30secs to run for input size N=20. How long will the same algorithm take for input size N=400 ? ...

The “pattern-filling with tiles” puzzle

I've encountered an interesting problem while programming a random level generator for a tile-based game. I've implemented a brute-force solver for it but it is exponentially slow and definitely unfit for my use case. I'm not necessarily looking for a perfect solution, I'll be satisfied with a “good enough” solution that performs well. ...

Complexity of getting a file C#

Im thinking of storing a large number of files in a folder and load them into my C# program. The problem I thought about was the performance when loading a file to read from, from a folder that contains very many files. Will the time to load and read from a file be about the same when there is one file in the chosen folder or one million...

Detect if a regexp is exponential

Hi, This article show that there is some regexp that is O(2^n) when backtracking. The example is (x+x+)+y. When attempt to match a string like xxxx...p it going to backtrack for a while before figure it out that it couldn't match. Is there a way to detect such regexp? thanks ...

Computational complexity of TreeSet operations in Java?

Hello there. I am trying to clear up some things regarding complexity in some of the operations of TreeSet. On the javadoc it says: "This implementation provides guaranteed log(n) time cost for the basic operations (add, remove and contains)." So far so good. My question is what happens on addAll(), removeAll() etc. Here t...

What is the technical definition of theoretical computer science? What subfields are included?

What is the technical definition of theoretical computer science? (Or, what should it be?) What main subfields does it include, and what is the commonality that separates them from the rest of computer science? More specifically: if some particular research has direct practical motivations, goals and outcomes but mostly involves very ...

Use of Boost Bimap in C++

C++ Boost has Bimap container that is a bidirectional map: http://www.boost.org/doc/libs/1_43_0/libs/bimap/doc/html/index.html Does anyone know the performance of Boost::bimap? I mean what's the time complexity of accessing an element in the map? Is it as quick as unordered_map access (which is O(1))? Thanks! ...

Performance Characteristics of Fundamental Operations for Computational Estimation of Algorithmic Complexity

I've made a compiler for a general-purpose programming language. As part of the toolchain, I'd like to include a profiler with the ability to estimate the time complexity of a given expression. It seems fairly straightforward to calculate the algorithmic complexitythat is, assuming all constant-time operations take the same amount of tim...

Explain the proof by Vinay Deolalikar that P != NP.

Recently there has been a paper floating around by Vinay Deolalikar at HP Labs which claims to have proved that P != NP. Could someone explain how this proof works for us less mathematically inclined people? ...

P≠NP - Is this solved?

Possible Duplicate: Explain the proof by Vinay Deolalikar that P != NP. Hi, I've just received this link, to a newly-published article of an HP researcher. The article presents a proof to the P≠NP theorem. Wikipedia has an article about the author, and slashdot has published another article. Is this true? ...