diff --git a/subjects/mobile-dev/data-structures/README.md b/subjects/mobile-dev/data-structures/README.md index 18c82a87..8b8c859c 100644 --- a/subjects/mobile-dev/data-structures/README.md +++ b/subjects/mobile-dev/data-structures/README.md @@ -1,43 +1,45 @@ -# Data Structures +## Data Structures ### Instructions -In this exercise you will work with the following data structures: List, Set, and Map. +Let's take a look at `List`, `Set`, and `Map`. Declare and initialize following variables: -- `listNum` of type `List` containing a list of integers (list length >= 5); -- `listObj` of type `List` containing a list of items of different types (list length >= 4); -- `listStr` of type `List` containing a list of strings (list length >= 3); -- `listList` of type `List>` containing a list of lists containing `listNum`, `listObj`, `listStr`; -- `setStr` of type `Set` containing at least 3 items; -- `mapStr` of type `Map` containing at least 3 pairs; - -### Usage +- `listNum` of type `List`, containing a list of integers. There must be at least 5 elements in the list. +- `listObj` of type `List`, containing a list of objects. There must be at least 4 elements in the list. +- `listStr` of type `List`, containing a list of strings. There should be at least 3 elements in the list. +- `listList` of type `List>`, containing a list of lists containing `listNum`, `listObj`, `listStr`. +- `setStr` of type `Set`, containing at least 3 strings. +- `mapStr` of type `Map` containing at least 3 pairs. ### List -List is an array of elements. In dart lists are initialized as following: +`List` is an array of elements: ```dart -var listNum1 = [1, 2, 3]; -// or ... -List listNum2 = [1, 2, 3]; +var listNum = [1, 2, 3]; +``` + +```dart +List listNum = [1, 2, 3]; ``` ### Set -Set is an unordered collection of unique items. Sets are created as follows: +`Set` is an unordered collection of unique items: + +```dart +var set = {'Germany', 'Kazakhstan', 'France', 'England'}; +``` ```dart -var set1 = {'Germany', 'Kazakhstan', 'France', 'England'}; -// or ... -Set set2 = {'Germany', 'Kazakhstan', 'France', 'England'}; +Set set = {'Germany', 'Kazakhstan', 'France', 'England'}; ``` ### Map -Map is a key-value data structure. Maps are created as: +`Map` is a key-value data structure: ```dart var mapRadius = { @@ -45,7 +47,9 @@ var mapRadius = { 'Jupiter': 71492, 'Moon': 1738.1, }; -// or ... +``` + +```dart Map mapRadius = { 'Earth': 6378.1, 'Jupiter': 71492, @@ -53,4 +57,4 @@ Map mapRadius = { }; ``` -- Note: main is not needed! +> No main is needed.