Flashcards
CS160
Cards in this deck (26)
- 1What is an Algorithm?A set of unique steps to solve a solvable problem.
- 2What is Decomposition? (in CS)Breaking a problem into smaller steps.
- 3What are the two types of abstraction?Specification
&
Parameterization - 4What are two ways to measure the complexity of an algorithm?Experimentation (measure time)
or
Hypothetical (big O) - 5What are primitive operations?Basic operations that take one time cycle in RAM.
(comparison, arithmetic, assignment, function calls, returning, referencing, etc.) - 6What are some common big O values?1, log(n), n, n^2, n^3
- 7From a function how can you determine the big-O value?Drop any constants and lower-value terms
- 8What does Big-O measure?The worst possible runtime of an algorithm
- 9What does Big-Theta measure?The actual runtime of an algorithm
- 10What does Big-Omega measure?The best runtime of an algorithm
- 11Does a linked list have random access?No
- 12Does an array have random access?Yes
- 13Can an array be resized?No
- 14What elements make up a linked list?nodes and pointers
- 15In what order are items added and removed from a stack?Last in, first out. (LIFO)
- 16What is the method used to add an item to the stack?Push(item)
- 17What is the method used to remove an item from a stack?Pop()
- 18When should Pop() throw an error?When the stack is empty
- 19In what order are items added and removed from a queue?First in, first out. (FIFO)
- 20What is the method used to add items to the queue?Enqueue(object)
- 21What is the method used to remove items from the queue?Dequeue()
- 22What is the difference between a singly linked list and a doubly linked list?With a singly linked list, you can only travel in one direction. With a doubly linked list, you can travel in both directions.
- 23Does a sequence have random access?Yes
- 24What is a circular array?An array that wraps left to right
- 25How can you determine if a function uses recursion?If the function calls itself.
- 26What is required for recursion?A base case. (When to stop)
Information
- Description
- Computer Science Flashcards on CS160, created by Rose Martinsen-Burrell on 10/09/2024.
- Created by
- Rose Martinsen-Burrell
- Views
- 2
- Rating