* Lecture 1 [2024-01-16 Tue] ** Recommended Books - Data Structures Using C and C++, by Langsam, Augenstein, and Tenenbaum - Data Structures and Algorithm Analysis in C, Mark Allen Wiss ** Office Hours - Tuesday & Thursdays, 3pm - 4pm ** Attendance - Not mandatory - Missing will cause a loss of /bonus/ points ** Late Work - Point reduction for late work ** Why Study Data Structures *** Application - Big Data - Data is everything and it must be managed to extract information - Applications, websites must be optimized (Data access) *** Student - Fundamental - Develops thinking for programming - Improves solving problems with better time complexities (performance) - Many self-taught programmer lack fundamentals of Computer Science - Popular technologies change, Data Structures or Analysis of Algorithms remain the same *** Textbook Definition - Refers to a scheme for organizing related pieces of information - Basic types of data structures include: - Files / lists - Arrays / Records - Trees / Tables - Graphs ** Types of Data Structures *** Structures & Unions - Stuctures Contains ordered group of data objects, each data object in a structure is a /member/ or a /field/. - Union Similar to a structure except that all of its members start at the same location in memory. A union variable can represent the value of only one of its members at a time. *** Graphs and Trees - Graphs and Trees are linked abstract data structures composed of nodes. - Each node contains a value and one or more pointers to other nodes arranged in a hierarchy. - Graphs can be used to represent networks, while variants of trees can be used for sorting and searching. *** Data Structure Operations 1. Traversal 2. Searching 3. Insertion 4. Deletion 5. Sorting 6. Merging *** Planning a Computer Program - As a programmer you are not supposed to start directly by coding - The most important part of programming is brain storming on how to solve the problem - First step can be on paper - Technically we term such steps as *Pseudocode* - Some programmers also use Algorithm to solve the issue on paper, then start programming *** Algorithm Specification - An *algorithm* is a finite set of instructions that, if followed, accomplishes a particular task. - All Algorithms must satisfy the following criteria: 1. Input 2. Output 3. Definiteness 4. Finiteness 5. Effectiveness *** How Programs Solve Problems - Program Flow Control - The order in which program statements are executed - Heuristics - Some problems are very complex or no algorithm exist to solve some problems, at such conditions programmers rely on heuristics - Intrusion Detection Systems can rely on heuristics to identify attacks - Heuristics are basically identified patterns or elements to assist in creating a solution to some problem