@?fundementals-of-data-structures

What is a vector an example of?? An Abstract Data Type What set do all $2$-d vectors come from?? $$ \mathbb{R}^2 $$ What set do all $3$-d vectors come from?? $$ \mathbb{R}^3 $$ What’s an example of where a $2$-d vector could be used?? To describe a path. What does the notation $S \to \mathbb{R}$ mean?? $S$ maps to $\mathbb{R}$. What is the notation $0 \to 1.5$ mean in terms of vectors?? $0$ maps to $1.
2020-11-09
2 min read
What is a tree?? A connected, undirected graph with no cycles. What is a binary tree?? A rooted tree where each node has at most two children. What type of data type is a tree?? An Abstract Data Type. What three terms are used for both actual trees and computer science trees?? Root, branches and leaves. What is the definition of the root of a tree?? The only node that doesn’t have a parent node.
2020-11-06
3 min read
In summary, what is a graph?? An abstract data type representing complex relationships. What is an undirected graph?? A graph where the edges don’t specify a direction. What does an edge represent in a graph?? A relationship between two nodes. What is an edge weight?? A numerical value associated with an edge. What does an edge weight commonly represent on a graph representing a map?? The distances between two places. What is a directed graph?? A graph where relationships can point one way only.
2020-11-05
2 min read
What is the main advantage of a hash table?? You can quickly find items given a key. A hash table is a type of what data type?? An Abstract Data Type. How is an element’s key calculated?? Using a hash function. A key-value hash table is sometimes called what?? A hash map. What is a hashing algorithm?? A calculation applied to a key to transform it into an address. What is it called when a hash function generates the same value for two different inputs?
2020-11-03
1 min read
Is a stack FIFO or LIFO?? LIFO. Where do you remove items from the stack?? From the top. What does LIFO stand for?? Last-in First-out What does the Pop operation do to a stack?? Returns and removes the item at the top of the stack. What does the Top operation do to a stack?? Returns but doesn’t remove the top item of the stack. What does the Push operation do to a stack?? Puts a new item of the top of a stack.
2020-10-23
1 min read
What is a queue?? A dynamic data structure in which items join at the back and leave at the front. Why is a queue a dynamic data structure?? Because it can contain a variable amount of data. Is a queue FIFO or LIFO?? FIFO. What does FIFO stand for?? First in first out. What is dequeueing?? Where an item is removed from the queue. What is enqueueing?? Where an item is added to the queue.
2020-10-04
4 min read