1/39
Looks like no tags are added yet.
Heap
A complete binary tree where each parent node's value is either higher or lower than the value of its child nodes.
Min Heap
A heap where the value of each parent node is less than or equal to the values of its child nodes.
Max Heap
A heap where the value of each parent node is greater than or equal to the values of its child nodes.
ArrayList
A resizable array implementation in Java from the java.util package used to create heaps.
addAll() method
A method to create a heap with initial values of the Collections class in Java.
Priority Queue
A special type of queue where elements are processed based on their natural or custom order.
PriorityQueue class
A Java class used to implement priority queues from the java.util package.
Enqueue
To add an element to a priority queue using add() or offer().
Dequeue
To remove an element from a priority queue using poll() or remove().
Comparator
An interface in Java used to create a specific ordering for a collection of objects.
comparing() method
A method in the Comparator interface used to define a custom comparison.
Set
A collection of unique elements in Java.
Union of sets
A set that contains all elements in either of two sets (A ∪ B).
Intersection of sets
A set containing only the elements common to both sets (A ∩ B).
Difference of sets
The set that contains elements in A but not in B (A – B).
Subset
Set A is a subset of set B (A ⊂ B) if every element of set A is in set B.
HashSet
A set implementation in Java that stores elements in a hash table without guaranteed order.
TreeSet
A set implementation in Java that stores elements in a sorted order (natural or custom).
LinkedHashSet
A set implementation in Java that maintains insertion order using a hash table and linked list.
containsAll() method
A method used to determine if one set contains all elements of another set.
retainAll() method
A method used to find the intersection of two sets.
removeAll() method
A method used to determine the difference between two sets.
Curly braces in Python
Used to implement sets in Python.
Dictionaries in Python
Maps in Python that use key-value pairs defined with a colon (:) within curly braces.
Map
A set of ordered pairs where elements are known as keys and values.
HashMap
A general-purpose map implementation in Java that does not guarantee order.
TreeMap
A general-purpose map implementation in Java that keeps its keys sorted.
LinkedHashMap
A general-purpose map implementation in Java that maintains insertion order.
put() method
A method used to insert a mapping in a map in Java.
remove() method
A method used to delete the mapping for a key in a map in Java.
replace() method
A method used to replace a key's value in a map in Java.
get() method
A method used to retrieve the value based on the key in a map.
containsKey() method
A method used to check if a map contains a mapping for a specified key.
keySet() method
A method that retrieves all keys of a map.
values() method
A method that retrieves all values of a map.
items() method
A method in Python used to display entries in a dictionary.
issubset() method
A method in Python to determine whether a set is a subset of another set.
Example of creating an empty set in Java
Set a = new HashSet();
Example of initializing a set in Python
a = set(['Mark', 'Nika', 'Mairo', 'Kae'])
Example of checking membership in a dictionary
print('M2' in name_map)