language agnostic - Complexity of algorithms of different programming paradigms -


i know programming languages turing complete, wonder whether problem can resolved algorithm of same complexity programming language (and in particular programming paradigm).

to make answer more explicit example: there problem can resolved imperative algorithm of complexity x (say o(n)), cannot resolved functional algorithm same complexity (or vice versa)?

edit: the algorithm can different. question complexity of solving problem -- using approach available in language.

in general, no, not algorithms can implemented same order of complexity in languages. can trivially proven, instance, hypothetical language disallows o(1) access array. however, there aren't algorithms (to knowledge) cannot implemented optimal order of complexity in functional language. complexity analysis of algorithm's pseudocode makes assumptions operations legal, , operations o(1). if break 1 of assumptions, can alter complexity of algorithm's implementation though language turing complete. turing-completeness makes no guarantees regarding complexity of operation.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -