Basic Computer Science Notes
Basic Computer Science Notes
• Definition:
o Computer Science is the study of computers, computational systems,
and the theoretical foundations of information and computation.
o Focuses on algorithmic processes, hardware and software design, and
data structures.
• Key Areas of Study:
o Algorithms: Step-by-step instructions for solving problems.
o Programming Languages: Tools to write software, such as Python, Java,
C++.
o Data Structures: Ways to organize and store data for efficient access and
modification (e.g., arrays, linked lists).
o Artificial Intelligence: Creating machines that can simulate human
intelligence.
• Brief History:
o Charles Babbage: Designed the first mechanical computer, the
Analytical Engine.
o Alan Turing: Considered the father of theoretical computer science;
introduced the concept of the Turing machine.
o Grace Hopper: Developed the first compiler, an essential tool for
translating high-level programming languages into machine code.
• What is an Algorithm?:
o A step-by-step procedure or formula for solving a problem.
o An algorithm must have input, output, and a clear set of operations.
• Algorithm Complexity:
o Time Complexity: The amount of time an algorithm takes to complete
based on the size of the input (measured in terms of Big O notation).
o Space Complexity: The amount of memory an algorithm uses as it
processes data.
• Big O Notation:
o Describes the upper bound of an algorithm's runtime or memory usage.
o Common complexities:
▪ O(1): Constant time, irrespective of input size.
▪ O(n): Linear time, increases proportionally with input size.
▪O(log n): Logarithmic time, decreases drastically as the input size
grows.
▪ O(n^2): Quadratic time, commonly found in nested loops.
• Common Algorithms:
o Sorting Algorithms: (e.g., Bubble Sort, Merge Sort, Quick Sort).
o Search Algorithms: (e.g., Binary Search, Linear Search).