Skip to content

Arihant garg diameter division#10

Open
ArihantGarg wants to merge 1 commit intoy23-24from
ArihantGarg-DiameterDivision
Open

Arihant garg diameter division#10
ArihantGarg wants to merge 1 commit intoy23-24from
ArihantGarg-DiameterDivision

Conversation

@ArihantGarg
Copy link

@ArihantGarg ArihantGarg commented Aug 27, 2023

Diameter Division

Divided solution into 2 parts :-

  1. Calculated diameter for all k upto root(n log n)
  2. Calculated remaining diameters using binary search on k

Time Complexity : O( (n log n)^3/2 ) , as root(n log n) dfs calls and each dfs takes O(n log n) (due to priority queue)

Runtime : 4.1 seconds on CodeDrills

@ArihantGarg ArihantGarg changed the base branch from main to y23-24 August 27, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant