Activity #17: Data Structure Agian

Activity #17: Data Structure Agian

The goal of this activity is to help you understand the key differences between three important data structures: List, Object, and List of Objects. This activity requires no coding; it is purely focused on comprehension of these concepts.

List

A list (also called an array in some languages) is an ordered collection of elements. It can hold a collection of items, such as names or numbers.

Example in the Table: If we only focus on the product names, the data forms a list.

Object

An object is a data structure that holds properties and values. Each object is made up of key-value pairs, where each key is associated with a specific value.

Example in the Table:

Each row in the table is an object, where the keys are the column names (ID, Name, Category, Price, Stock, Supplier Email) and the values are the data for each product.

Example of an Object:

This object describes a single product (Laptop) with its properties like id, name, category, price, stock, and Supplier email.

List of Objects

A list of objects is a combination of both data structures. It is a list (array) where each element in the list is an object. Each object contains detailed information about an entity (like a product).

Example in the Table:

The entire table represents a list of objects, where each row (product) is an object

This is a list of objects, where each object contains details about a product.

List

list is an ordered collection of elements, such as strings or numbers. It allows for simple and ordered data storage.

Example from Employee Table:

If we just look at the employee names, it forms a list:

This is a simple list containing just the names of the employees in order.

Object

An object is a data structure that holds data in key-value pairs. It describes an individual entity (in this case, an employee).

Example from Employee Table:

Each row can be represented as an object:

This object contains all the information related to a single employee (Jane Smith), including their ID, name, department, age, and email.

List of Objects

A list of objects is a collection (list) of multiple objects, where each object holds detailed information about a particular entity.

Example from Employee Table:

The entire employee table is a list of objects, where each employee is represented as an object:

This is a simple list containing just the names of the employees in order.

This list of objects stores details about multiple employees, where each object holds the data for one employee.

List

A list is an ordered collection of elements, which can be a simple data structure containing items like strings or numbers.

Example from the Books Table:

Object

An object is a data structure that stores data as key-value pairs, representing one entity like a book.

Example from the Books Table:

Each row in the table can be represented as an object for a specific book. For example, the second book "To Kill a Mockingbird"

This object holds all the details of one specific book, including its ID, title, author, genre, and so on.

List of Objects

A list of objects is a collection where each item is an object that holds detailed information about a specific entity, such as books.

Example from the Books Table:

The entire books table can be seen as a list of objects, with each book represented as an object:

This list of objects holds detailed information for each book in the list.

List

A list is an ordered collection of items.

Example from the University Table:

If we take just the names of the universities, it forms a list:

This is a simple list of university names.

Object

An object is a data structure that contains key-value pairs, representing a single entity.

Each row in the table can be represented as an object for a specific university. For example, the second university

Example from the University Table:

This object holds all the details of one specific university.

List of Objects

A list of objects is a collection where each item is an object containing detailed information about a specific entity.

Example from the University Table:

The entire university table can be seen as a list of objects, with each university represented as an object:

This list of objects holds detailed information for each university in the list.

List

A list is an ordered collection of items.

Example from the Restaurant Table:

If we extract just the names of the restaurants, it forms a list:

This is a simple list of restaurant names.

Object

An object is a data structure that contains key-value pairs, representing a single entity.

Example from the Restaurant Table:

Each row in the table can be represented as an object for a specific restaurant. For example, the second restaurant. “Antonio’s Restaurant”

This object holds all the details of one specific restaurant.

List of Objects

A list of objects is a collection where each item is an object containing detailed information about a specific entity.

This list of objects holds detailed information for each restaurant in the list.