What is the complexity of dijkstra algorithm but without the vis array and without checking for dist array code https://ideone.com/VTaE03

# | User | Rating |
---|---|---|

1 | Petr | 3325 |

2 | OO0OOO00O0OOO0O0…O | 3289 |

3 | Um_nik | 3278 |

4 | Syloviaely | 3274 |

5 | tourist | 3206 |

6 | Radewoosh | 3197 |

7 | V--o_o--V | 3167 |

8 | mnbvmar | 3096 |

9 | dotorya | 3086 |

10 | FizzyDavid | 3023 |

# | User | Contrib. |
---|---|---|

1 | tourist | 183 |

2 | rng_58 | 168 |

3 | csacademy | 160 |

3 | Petr | 160 |

5 | lewin | 151 |

6 | Swistakk | 150 |

7 | matthew99 | 142 |

8 | BledDest | 141 |

9 | Errichto | 140 |

10 | adamant | 139 |

What is the complexity of dijkstra algorithm but without the vis array and without checking for dist array code https://ideone.com/VTaE03

↑

↓

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/23/2018 08:56:55 (d3).

Desktop version, switch to mobile version.

User lists

Name |
---|

What's the meaning of

`k`

in the code?k is the total amount of money i have and each edge have cost and length cost is p and length is l

It can be quadratic, for example this directed graph:

Initial node is connected with k nodes (with cost 1), these k nodes are connected with another node (middle)(with costs k, k — 1 , k — 2..., 1). Middle node is connected with another k nodes (with cost 1), which are connected to the final node (with cost oo, a.k.a. big enough).

Certainly middle node will be visited k times, and visiting it requires k operations, as it has k neighbours. So total complexity would be at least .

If I understood the code correctly it wouldn't be difficult to construct

O(2^{n}) in a similar way.