Identifying Isomorphic Trees | Source Code | Graph Theory

Поділитися
Вставка
  • Опубліковано 5 жов 2024

КОМЕНТАРІ • 11

  • @mayankpant1596
    @mayankpant1596 Рік тому +1

    Feels really nice when you are able to code this all on your own. Thanks a lot man. Your lectures are a blessing.

  • @curtism7302
    @curtism7302 3 роки тому +1

    I am definitely going to have to watch this more than 8-12 times.

  • @Doomguards
    @Doomguards 4 роки тому +1

    Thanks for the effort you put in these :)

  • @tusharrawat1581
    @tusharrawat1581 4 роки тому +2

    What would be the time complexity for the encode function?
    I think it should be O(v + e) + O(v * k * clogc), where v = num nodes, e = num edges, c = number of children & k = length of subtree encoding.
    For every node in the tree, we are sorting labels array which consists of node.children.size() (c) strings each of length let's say k (multiple of 2) so it would take (k * clogc) in sorting encodings of subtrees and for every v vertex in the tree time would be O(v * k*clogc).
    Is this analysis correct? If yes how to express k and c in terms of v and e.

  • @kevintran6102
    @kevintran6102 4 роки тому

    This is awesome. I learned a lot from you.

  • @mersenne2486
    @mersenne2486 6 місяців тому

    awesome, could anyone tell how to implement the lexicographic sorting in c++

  • @rushilp1230
    @rushilp1230 4 роки тому +1

    It would have been good if you could explain what is the structure of the trees, and how your representing them.
    How is the tree represented as List ?

    • @BPShyam
      @BPShyam 4 роки тому +3

      It is a adjacency list. You could refer to the first video in the playlist...

    • @GotUpLateWithMoon
      @GotUpLateWithMoon 2 роки тому

      In last video, each treeNode is defined as a class with id, parent and children. Apparently each node is only linked only to its neighbors now using adjacency list and the class is reduced to an integer id. It would be helpful to point out the gap since the representation changed a bit and it affects the implementation.

  • @rashigupta9613
    @rashigupta9613 3 роки тому +1

    What if the first tree has two children?

    • @mersenne2486
      @mersenne2486 6 місяців тому

      you mean two center nodes