The document provides information on computer science fundamentals including hardware, operating systems, algorithms and their time complexities, common data structures, and design techniques. It covers topics like the central processing unit, memory, software, languages, asymptotic analysis, arrays, linked lists, trees, stacks, queues, graphs, and algorithms like brute force, divide and conquer, dynamic programming and greedy.
The document provides information on computer science fundamentals including hardware, operating systems, algorithms and their time complexities, common data structures, and design techniques. It covers topics like the central processing unit, memory, software, languages, asymptotic analysis, arrays, linked lists, trees, stacks, queues, graphs, and algorithms like brute force, divide and conquer, dynamic programming and greedy.
Hardware and software fundamentals Operating system Asymptotic time complexity
Software that supports a computer's basic functions, manages computer A platform- and input-independent analysis that computes the exact running hardware and software resources, and provides common services for time of an algorithm. It tells us how a program performs as the size of input Hardware is anything physically connected to a computer. computer programs grows regardless of the underlying machine. Big O is used to represent the upper bound, Big Omega is used to represent the lower bound, and Big Central Processing Unit (CPU) User applications Theta is used to represent the tight bound of running time. A physical object that takes data from the main memory, processes it, and Software written for the end-user that's designed to carry out a task returns the updated data to the main memory. unrelated to the operation of the computer system. Time complexity of recursive algorithms Can be computed using the substitution method, Master's theorem, or Control unit (CU) recursion tree. A subunit of the CPU that controls data flow from and into the main memory. Data structure fundamentals Asymptotic space complexity An analysis of how much memory an algorithm takes. Arithmetic and logic unit (ALU) Data structures: Formats for the organization, management, and Subunit of the CPU that is responsible for processing arithmetic and logic Correctness proof techniques storage of data that enable efficient access and modification. operations. Used to prove that a given algorithm is correct and will always produce the Array intended output. The most common and widely used technique is loop Input units invariant, which is based on mathematical induction. A collection of items of the same variable type that are stored sequentially in Take data from the world or an input device and convert it into streams of memory. Best suited for retrieving data in a constant time (using index) but bytes. Design techniques don't provide fast data insertion or deletion. Output units Brute force Linked list Take processed data from the CPU and render it in a Requires going through all possibilities to find a solution to a problem. The A linear sequence of nodes linked together. In a singly linked list, each node human-understandable way. least efficient method and one that mostly doesn't provide the desired contains a value and a pointer to the next node in the list. Linked lists provide faster data insertion and deletion but slower data retrieval compared to solution in a feasible time. Storage units arrays. Where data is stored after being retrieved and processed. The physical Divide and conquer memory space. Breaks a problem into smaller subtasks that are then solved using recursion Tree A non-linear data structure often used to represent hierarchical data. and eventually reassembled. Recursion is the practice in which a function Memory calls itself directly or indirectly. Examples include merge sort and quicksort. The main memory and RAM (physical spaces in the computer) and Stack secondary storage (e.g. hard drives). Dynamic programming A linear structure with last-in, first-out (LIFO) order. Imagine a stack of plates. The last plate placed on top of the stack is the first taken out. Similar to divide and conquer. Divides a big problem into small subtasks and Software is a collection of programs and procedures that perform combines their solutions. Unlike divide and conquer, a subtask may overlap tasks on a computer. Queue with other subtasks. To reduce running time, results of each subtask are A linear structure with first-in, first-out (FIFO) order. Imagine lining up for a saved in memory, a process called memoization. Machine language roller coaster. The first people who line up leave the line for the ride first. The only language the computer can process: a stream of ones and zeros Greedy (binary). A low-level language. Graph A solution for each subtask is attempted using the best available local - An abstract notation that represents the connection between all pairs of solution, called local optima. This approach yields optimal results only when Assembly language objects. local optima leads to the global optima, the best possible global solution. A human-readable language that translates binary into assembly instruction, which must be translated into machine language for the Hash table Other techniques computer. A low-level language. A structure implemented by storing elements in an array and identifying Approximation algorithms find a near-optimal solution when finding an them through a key. A hash function takes in a key and returns an index for optimal solution is either time-consuming or not feasible. Other techniques High-level programming languages which the value is stored. include randomized algorithms and linear programming. Allow the writing of human-readable programs without large amounts of low-level instructions (i.e. assembly language instructions). Heap Key categories An advanced tree-based data structure used primarily for sorting and Assembler implementing priority queues. Sorting and searching algorithms A utility program that translates an assembly language program into Put elements of a list in order, or check for or retrieve an element from any machine language. data structure where it's stored. Sorting examples: mergesort, quicksort, bubble sort, selection sort, and insertion sort. Searching examples: linear Compiler Algorithm fundamentals search and binary search. A program that translates human-readable source code into machine-readable target code in a low-level language. Once the Graph algorithms translation is complete, the target code is passed to the target machine Algorithm: A series of well-defined instructions that tell a computer Solve problems of representing graphs as networks. A graph is an abstract for execution. what to do to solve a problem. Algorithms are applied to data notation that represents the connection between all pairs of objects. structures. Interpreter Shortest path algorithms A program that translates human-readable source code into Find the shortest path in a graph. Many sorting algorithms exist. An machine-readable target code in a low-level language command by Complexity and correctness concepts algorithm is selected based on the type of data, its size, and the user command while the source code is being executed. application.