reading-notes

Data Structures and Algorithms

# Discussion Questions:

  1. What is 1 of the more important things you should consider when deciding which data structure is best suited to solve a particular problem?

    It is important to carefully consider the nature of the data before selecting a suitable data structure. So When selecting an appropriate data structure for solving a specific problem, it is crucial to take into account the characteristics of the data that require storage and manipulation. Each data structure is designed to handle distinct data types and has its own unique advantages and limitations.

  2. How can we ensure that we’ll avoid an infinite recursive call stack?

1. Data Structures

Data Structures are essentially ways of organizing and storing data in a computer program so that it can be efficiently processed and accessed. They provide a set of operations for working with the data, such as adding, removing, searching, and sorting elements. Compound data refers to data structures that contain multiple values or pieces of data. In computer science, there are several types of compound data structures that are commonly used, including arrays, linked lists, trees, graphs, and hash tables.

Examples of commonly used data structures are

  1. Node
  2. Linked lists
  3. Array
  4. Hash tables {}
  5. Double [Stack + Queue]
  6. Graphs + Trees

1. Node

Is a fundamental concept in computer science and data structures, particularly in linked data structures such as linked lists, trees, and graphs.

2. Linked lists

A linked list is a linear data structure in which a sequence of elements is stored using pointers or references to other nodes. Each element in the list is called a “node” and contains a data value and a reference or pointer to the next node in the sequence.

3. Array

An array is a collection of elements of the same data type that are stored in contiguous memory locations. Each element in the array is identified by an index or a subscript, which represents its position in the array

4. Hash Tables

Is a data structure that maps keys to values using a hash function. 
In a hash table, a key is input into a hash function,hash tables also have some limitations.

5. Double [Stack + Queue]

 known as a deque, is a data structure that combines the features of both a stack and a queue. Like a queue, a deque allows elements to be inserted and removed from both ends of the structure. Like a stack, a deque allows elements to be inserted and removed from only one end of the structure.

6. Graphs + Trees

A graph is a collection of nodes, or vertices, connected by edges. The edges can be directed or undirected, and can represent any kind of relationship between the nodes. Graphs can be used to model many real-world problems, such as social networks, transportation networks, and communication networks. A tree is a type of graph where each node has at most one parent and zero or more children. Trees are often used to represent hierarchical structures.

The reading Resources:

 https://www.youtube.com/watch?v=sVxBVvlnJsM 
 https://www.programiz.com/dsa/data-structure-types

## 2. Recursive : Recursive functions are functions that call themselves one or more times, either directly or indirectly. In a recursive function, the problem is divided into smaller subproblems, and each subproblem is solved by recursively calling the same function. #### Recursive case:

This is the part of the function where it calls itself to solve a smaller subproblem.

#### Base case:

This is the stopping condition for the recursive function. It determines when the function should stop calling itself and return a value. ## 3. Big O notation Big O notation is a way of describing the time complexity of an algorithm, or how the runtime of an algorithm grows as the size of the input increases. It is typically used to analyze the performance of algorithms and compare them to each other in terms of their efficiency. and there are some common operations and their corresponding Big O notations:

  1. .add()
  2. .get()
  3. .sort()
  4. .search()

Things I want to know more about

Learn how to use Python to create networked applications, also how Python related with machine learning and data science.