Question d’entretien chez ServiceNow

write a program to check whether a binary tree is BST or not?

Réponse à la question d'entretien

Utilisateur anonyme

23 avr. 2019

Traverse the BST in InOrder and store the values in to an array or list. As InOrder gives a sorted list, we can compare if the list is already sorted or not by a simple loop