When I am about to know some algorithms I confused about what exacly is input size. For example in travelling sales person problem dynamic programming implementation takes O(2n × n2) And krushals algorithm takes O(E log V).Though both are graph problems why TSP input size is no.of Vertices n and krushals input size is in Edges and Vertices. How to know exactly what can be taken as input size
CodePudding user response:
You can state an algorithm's complexity in terms of whatever variables you like.
You should generally choose them to clearly communicate useful information about the running time of the algorithm.