Outline
Data structures and algorithms are the foundation of Computer Science. They play a crucial role in solving computational problems efficiently.
Data Structures and Algorithms consider factors such as:
- Time Complexity
- Space Complexity
- Other requirements for the problem
What are Data Structures?
Data Structures are the organization and storage of data. Data structures provide multiple ways to arrange the same data.
Data Structures affects:
- Performance
- Efficiency
- Maintainability of a program
Data structures rely on algorithms to perform operations efficiently.
What are Algorithms?
Algorithms are a set of instructions for completing a specific task of solving a problem. They are many algorithms for most problems. Some algorithms are orders of magnitudes faster than others. Algorithms rely on data structures for organization and storage.
Data structures and algorithms go hand in hand.
There are many types of algorithms:
- Searching
- Path Finding e.g. Networks, maze, or GPS
- Sorting e.g. Files and Records
- Brute Force e.g. when there is no elegant method available
- Dynamic Programming e.g. breaking down complex problems into smaller sub-problems and then solving them later for reference
Applications
There are many applications for algorithms:
- Graphics
- Database
- Numerical Analysis
- Artificial Intelligence
- Data Science
- Almost everything
Pseudocode
Pseudocode is the artificial language used to describe steps in an algorithm. Pseudocode uses conventions of a programming language such as conditionals, loops. Pseudocode is not necessarily tied to any programming language. Pseudocode is intended for human comprehension.
Programming Language
Code demonstrations will be in Python. Python is syntactically clean and close to pseudocode. It is also easier for a Java/C/C++ programmer to learn Python that vice-versa.
We will use general language constructs as possible so it is easier to rewrite in other languages. Our focus is clarity, not optimization. We will not use language specific features that may make the code more faster, but instead write code that will make it more clear.
Practical Considerations
When working in most programming languages, most data structures and algorithms are already built-in. The built-in code is usually highly optimized. It is still very important to understand how it works. This understanding will allow you to make better decisions in the the choice of data structures and/or algorithms to use. Understanding how the algorithms helps you understand tradeoffs. Understanding these built-in algorithms may also allow you to implement modified versions of the existing code. The existing code might solve your problems partially, but you might have to modify it to make it work for your specific problem.