Azt kell, hogy „hozzon létre egy prioritási sor által végrehajtott bináris kereső fába (BST)” az én algoritmusok II osztályban. Azonban nem vagyok biztos, hogy pontosan hogyan is használja bináris kereső fába, mint egy sornak. Tudna valaki tisztázni, mi az, hogy a hozzárendelés, mit tegyek?
Referenciaként, itt vannak a módszerek a PriorityQueue kell végrehajtani:
add – adds a new item to the queue
peek – returns the head of the queue
remove – removes the head of the queue and returns it
search – returns the position of an element in the queue, or -1 if it is not found.
size – returns the total number of elements in the queue
inorder – returns an in-order, comma-separated string of every element in the queue
preorder – returns an pre-order, comma-separated string of every element in the queue
height – returns the height of the underlying BST
Köszönöm előre is minden tanácsot !!













