NLM Big O Exam 2 Summary
NLM Big O Exam 2 Summary
Priority Queues
A priority queue is a data structure that allows you to insert elements with an associated priority
and efficiently retrieve the element with the highest priority.
size O(1)
empty O(1)
Binary Trees
A binary tree is a tree data structure where each node has at most two children, referred to as
the left and right children.
A binary search tree is a type of binary tree where nodes are ordered based on their keys,
allowing efficient search, insertion, and deletion operations.
size O(1)
empty O(1)
AVL Trees
An AVL tree is a self-balancing binary search tree that ensures a balanced structure to
guarantee logarithmic time complexity for operations.
Hash Tables
A hash table is a data structure that uses a hash function to map keys to indices in an array,
allowing efficient access, insertion, and deletion operations.
Binary Search
Binary search is an algorithm for finding a target value in a sorted array by repeatedly dividing
the search interval in half.
Sorting a list of elements can be done using a priority queue by inserting all elements into the
queue and then removing them in sorted order.
Huffman Coding
Huffman coding is a data compression algorithm that uses a priority queue to build a Huffman
tree, assigning variable-length codes to characters based on their frequencies.
The time complexity of the algorithms and operations can vary depending on the specific
implementation and the characteristics of the data being processed. However, this cheat sheet
provides a general overview of the expected performance based on the information in the
sources.