Advanced Algorithms Flashcards
What is an algorithm?
(Informally) Any well-defined computational procedure that takes a set of values as input and produces a set of values as output.
An algorithm is a sequence of computational steps that transforms the input into the output.
What are the 4 basic data structures?
Arrays - Fixed size and contiguous (in a sequence) in memory
Multi-dimensional arrays -
Lists - A dynamic array
Strings - One dimensional arrays of characters ended by a null character
What is Big O?
What are the examples of Big O?
What is the difference between arrays, strings and lists?
How to choose a sort algorithm?
These are the different factors that determines what sorting algorithm you use:
-Size of the data set
-Degree of order
-The distribution of the data set
-The amount of information associated with each data item
What are the advantages and disadvantages of bubble, selection, merge and quick sorts?
What is the difference between divide and conquer and dynamic programming?
What is the difference AVL and Red-black trees?
Why do we need heaps and treaps?
Where do we use B-trees?
What are tuples?
What are sets?
What are dictionaries?
What are the features of stacks and queues?
When and why do we use linked lists?
What is the difference between singly, doubly, and circular linked lists?
Why do we use hash tables?
What happens if a collision happens in a hash table and how do you avoid them?
What is the load factor in a hash table?
What are the differences for four types of linked lists? not sure what that means
Which data structures are dynamic and what does dynamic mean?
Why and when do we use AVL?
Why and when do we use Red-black?