All Flashcards
What is the growth time for binary search?
O(log n)
What is an example of an O(n) algorithm?
Simple search
What is an example of an O(n * log n) algorithm
Quicksort
How does array storage differ from linked list storage?
Arrays store elements sequentially, while linked lists store elements with pointers to the next element.
What are the two cases in recursive functions?
Base case and recursive case
What is good about Hash tables?
fast search, insert, and delete operations
What is the main purpose of breadth-first search?
to find the shortest path between two nodes.
What distinguishes a tree from other graphs?
Trees don’t have cycles
What is Dijkstra’s algorithm used for?
to find the shortest path in a weighted graph with nonnegative weights.
How do greedy algorithms work?
Greedy algorithms make locally optimal choices in the hope of achieving a globally optimal solution.
What is KNN used for?
classification and regression
What is classification
categorization into a group
What is regression
predicting a response
What does NP-hard mean?
if every problem in NP can be reduced to it.
What does NP-Complete mean?
If a problem is in both NP and NP-hard
How does Divide & Conquer work?
By breaking down a problem into smaller and smaller pieces.
How do you make a Hash Table
by combining a hash function with an array
What is the order followed by a queue?
FIFO (First In First Out)
What is the order followed by a stack?
LIFO (Last In First Out)
What is the international standard character encoding
Unicode
What is the most common character encoding
UTF-8
How do AVL trees balance themselves?
By rotation
What algorithm should be used with negative weights
Bellman-Fords algorithm
What is feature extraction
converting an item into a list of numbers that can be compared
What is Euclid’s algorithm
It is used to find the greatest common factor