Given a Binary Search Tree T and a key value k design an algorithm to efficiently locate and return all the records with key value equal to k. The psedudocode shows below please explain when worse case occurs and provide as tight an upper bound on the worst case asymptotic running as you can.The pseudocode:Note: L=store a list of nodes with k initially set to nil .pALL-EQUAL-(TKL)if T.left = k L.p = T.left L = L.nextif T.right = k L.p = T.right L = L.nextif T.left != NULL ALL-EQUAL (T.left K L)if T.right != NULL ALL-EQUAL (T.right K L)HINT: you might want to express the running time as a function of the height h of the tree and the numb found that have key values equal to k.