For calculating longest substring we can use following algorithms:1. Dynamic Algorithm2. Hirschberg’s algorithmkodeknight String subsequence Dynamic Programming DP substring See alsoConvert String to ZigZag Bottom UpFor a Given node of a binary tree, print the K distance nodes.Find the distance between 2 nodes in Binary TreeFind the distance between 2 nodes in Binary TreeProgram to count leaf nodes in a binary tree