Data Structures vs Algorthims Flashcards
What is a data structure?
A way to organise and store data efficiently.
Name a few data structures:
Arrays
Linked list
Stacks
Queues
Trees
Graphs
Hash Tables
What is an algorithm?
A finite sequence of instructions used to solve a problem.
Why is an algorithm used?
To manipulate data in the form of searching, sorting etc.
How does the choice of data structures affect the performance of algorithms?
Different data structures provide varying levels of efficieny for basic operations.
What does a sorting algorithm do and what types are there?
Used to arrange data in a specific order:
Quick sort
Merge sort
Bubble sort
Heap sort
What does a searching algorithm do and what types are there?
Used to find an element within a data structure:
Binary search
Linear search
What does a divide and conquer algorithms are there?
Merge sort
Quick sort