-
Priority queue node which stores the object entered, T value – object, int priority – the priority value
HeapNode<T extends Comparable> implements Comparable<HeapNode<T>>
-
Return 0,1,-1 depending on the priority of the value entered and then comparing the insertion order
int compareTo(HeapNode<T> node)
Class MaxHeap extends PriorityQueue interface
-
Inserting the object based on the priority
void insert(T element)
-
Number of elements stored in the priority queue
int count()
-
Return the highest priority element in the max-heap
T extractMax()
Class Student implements comparable
- Return the name of the student
String getName()
- Return the to be printed stuff as per the assignment requirement
String toString()
-
Constructor
Person person = new Person(String name,String phone_number)
-
Return the name of the student
String getName()
-
Return a string as per the assignment requirement
String toString()
Class Trie<T> implements TrieInterface<T>
-
Delete the element stored with the given string and returns true if got deleted else, returns false
boolean delete(String word)
-
Return the TrieNode with the given String as key
TrieNode search(String word)
-
Return a new node with all properties set to null if the key is not found else return 1 node which can follow up on the given string
TrieNode<T> startsWith(String prefix)
-
Print the trienode with sorted outputs
void printTrie(TrieNode trienode)-
-
Insert the given value with the given key and returns a Boolean verifying the insertion to be true or false
Boolean insert(String word,T value)-
-
Print all the items present at a particular level in a Trie
void printLevel(int Level)-
-
Print the entire tree with all the levels separately marked
void print()
Class RBTree<T extends Comparable, E implements RBTreeInterface<T,E>
- Constructor
RBTree<T,E> constructor = new RBTree()
- Insert the given element with the given key
void insert(T key, E value)-
- Print the required node stored with the given key
RedBlackNode<T,E> search(T key)