K
K
kate2018-08-20 01:08:41
C++ / C#
kate, 2018-08-20 01:08:41

How to calculate the complexity in the code itself?

Is it possible after, for example, sorting, to make the complexity of the algorithm calculated and displayed on the screen?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Zagaevsky, 2018-08-20
@zagayevskiy

You can count the number of certain operations and output it, for example.

X
xmoonlight, 2018-08-20
@xmoonlight

You can make a "tree" of iterations and, based on the analysis of the nodes of this "tree", determine the complexity.

D
devalone, 2018-08-21
@devalone

You can run the code on different inputs and see which function increases the calculation time

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question