--- slideOptions: theme: white --- # Chapter 11 - Introduction to Data Structure and Algorithms ###### tags: `Data Structure and Algorithms` --- ## Learning objectives By the end of this chapter, you should able to: 1. Defind data strctures and algorithms ## Algorithm and Pseudocode The term “algorithm” means, in computer science, the step by step method of solving a problem. Pseudocode is the most common method to define an algorithm, which is an English-like and syntax-free representation of algorithm logic. Below shows an example of pseudocode that prints the deviation. ```pseudocode! Algorithm deviation Pre nothing Post average and numbers with their deviation printed 1 loop (not end of file) 1 read number into array 2 add number to total 3 increment count 2 end loop 3 set average to total / count 4 print average 5 loop (not end of array) 1 set devFromAve to array element - average 2 print array element and devFromAve 6 end loop end deviation ``` There are two points worth mentioning in the above algorithm. First, there are no parameters. Second, as previously explained, we do not declare variables. A variable’s type and purpose should be easily determined by its name and usage. In the later chapters, we will focus on two kinds of algorithms, namely *sorting* and *searching*. ## Data Strcutures A *data structure* is an aggregation of atomic and composite data into a set with defined relationships. In this definition, *structure* means a set of rules that holds the data together. In other words, if we take a* combination of data and fit them into a structure* such that we can define its related rules, we have made a data structure. Below shows some examples of data structures. ![](https://i.imgur.com/vEuIrB7.png) ### Abstract data type model An abstract data type (ADT) is a data declaration packaged together with the operations that are meaningful for the data type. Inside the ADT are two different aspects of the model: data structures and functions (public and private). Below shows the ADT model in diagram. In this series, we will learn both *array-implementation* and *linked-list implementation* data structures. We will focus on three types of data structures, namely *linked list*, *stack* and *queue*. ![](https://i.imgur.com/mkcFZ7v.png) ## Learning path In the coming chapters, we will focus on the data structures and algorithms mentioned. Below is our learning path on data structure and algorithm. ![](https://i.imgur.com/KwPfMJ4.png)