मैं अपने एल्गोरिदम द्वितीय वर्ग के लिए एक प्राथमिकता कतार एक द्विआधारी खोज वृक्ष (बीएसटी) द्वारा लागू बनाने की जरूरत है। हालांकि, मुझे यकीन है कि वास्तव में कैसे आप एक प्राथमिकता कतार के रूप में एक द्विआधारी खोज वृक्ष का प्रयोग करेंगे नहीं हूँ। किसी को स्पष्ट कर सकते कि यह क्या है कि काम करने के लिए मुझे कह रहा है?
एक संदर्भ के रूप में, यहाँ तरीकों PriorityQueue को लागू करना चाहिए रहे हैं:
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
किसी भी सलाह के लिए अग्रिम धन्यवाद !!













