Lesson Non Linear Data Structures - Artificial Intelligence - ثالث ثانوي

Lesson 3 Non-Linear Data Structures

In the previous lessons, you learned about

Non-Linear Data Structures

Table 1.9: Differences between Linear and Non-linear Data Structures Linear

Lesson 3 Non-Linear Data Structures

Trees

Tree Terminology Used in the Tree Data Structure

Figure 1.35: Tree data structure

Tree

Edge

Lesson 3 Non-Linear Data Structures

Here is an example of a tree data structure.

Tree Data Structure Features

Lesson 3 Non-Linear Data Structures

Tree Data Structure in Python

Lesson 3 Non-Linear Data Structures

Binary Tree

Table 1.10: Types of binary tree data structures

Lesson 3 Non-Linear Data Structures

Decision Tree

Graphs

Graph

Table 1.11: Differences between Trees and Graphs

Lesson 3 Non-Linear Data Structures

Types of Graphs

Graphs in Everyday Life

Lesson 3 Non-Linear Data Structures

Facebook

Google Maps

Neural Network

Lesson 3 Non-Linear Data Structures

Graphs in Python

Lesson 3 Non-Linear Data Structures

if edge exists then append to the list

Lesson 3 Non-Linear Data Structures

Read the sentences and tick True or False.

State the difference between trees and graphs.

Describe how graph algorithms are utilized in commercial applications.

Lesson 3 Non-Linear Data Structures

Fill in the blanks with the correct names of the parts of the tree.

Lesson 3 Non-Linear Data Structures

• Complete its tree representation.

• Is it a binary tree? Justify your answer.

Lesson 3 Non-Linear Data Structures

Draw the tree that will result from the following information:

What type of tree is described above?

Lesson 3 Non-Linear Data Structures

Using the dictionary in Python, write the appropriate program to represent this tree and print the parents and children.