|
| 1 | +# Programming_dynamic_data_structures |
| 2 | +Laboratory work on an academic subject: "Programming dynamic data structures" |
| 3 | +____ |
| 4 | +## Content |
| 5 | +1. [Laboratory work 1](#Laboratory work 1. Creating functions that implement operations for creating work with sets) |
| 6 | +1.1. [Creating an empty set](#Creating an empty set - `Node* creatingAnEmptySet()`) |
| 7 | +1.2. [Checking for an empty set](#Checking for an empty set - `bool emptySet(Node* first)`) |
| 8 | +1.3. [Checking whether an element belongs to a set](#Checking whether an element belongs to a set - `bool checkingOfExistence(Node* first, int checking_value)`) |
| 9 | +1.4. [Adding a new element to the set](#Adding a new element to the set - `Node* add(Node*& first, int adding_value)`) |
| 10 | +1.5. [The power of the set](#The power of the set - `int powerOfTheSet (Node* first)`) |
| 11 | +1.6. [Creating a set](#Creating a set - `Node* creatingSet(int quantity, int min, int max, int k)`) |
| 12 | +1.7. [Output of elements of the set](#Output of elements of the set - `string printSet(Node* first, string separator)`) |
| 13 | +1.8. [Deleting a set (clearing the memory occupied by the list)](#Deleting a set (clearing the memory occupied by the list) - `Node* deleteSet(Node*& first)`) |
| 14 | +____ |
| 15 | +##Laboratory work 1. Creating functions that implement operations for creating work with sets |
| 16 | +A singly connected list of integer values is used to represent the set. OOP is not applied due to restrictions on the terms of reference |
| 17 | + |
| 18 | +| File name | File Contents | |
| 19 | +| ------------------------|----------------------| |
| 20 | +| Lab1_12_Kudashov.cpp | Main program | |
| 21 | +| SetLab1_12_Kudashov.h | Function set header file | |
| 22 | +| SetLab1_12_Kudashov.cpp | Function set implementation file | |
| 23 | + |
| 24 | +###Creating an empty set - `Node* creatingAnEmptySet()` |
| 25 | +*Input parameters:* None. |
| 26 | +*Output parameters:* a pointer to the first element of the list, equal to NULL. |
| 27 | +###Checking for an empty set - `bool emptySet(Node* first)` |
| 28 | +*Input parameters:* a pointer to the first item in the list. |
| 29 | +*Output parameters:* Boolean value. |
| 30 | +###Checking whether an element belongs to a set - `bool checkingOfExistence(Node* first, int checking_value)` |
| 31 | +*Input parameters:* a pointer to the first element of the list, the value of the element. |
| 32 | +*Output parameters:* Boolean value. |
| 33 | +###Adding a new element to the set - `Node* add(Node*& first, int adding_value)` |
| 34 | +*Input parameters:* a pointer to the first element of the list, a value to be added to the list. |
| 35 | +*Output parameters:* a pointer to the first element of the result list. |
| 36 | +*Restriction:* Adding an item to the top of the list. |
| 37 | +###The power of the set - `int powerOfTheSet (Node* first)` |
| 38 | +*Input parameters:* a pointer to the first item in the list. |
| 39 | +*Output parameters:* integer value. |
| 40 | +###Creating a set - `Node* creatingSet(int quantity, int min, int max, int k)` |
| 41 | +*Input parameters:* the number of elements, the range of acceptable values (from min to max). k is the multiplicity coefficient for checking the satisfaction of the condition. |
| 42 | +*Output parameters:* a pointer to the first element of the result list. Generation of values by a random number sensor. |
| 43 | +*Requirement:* check the possibility of creating a set with the specified parameters. |
| 44 | +###Output of elements of the set - `string printSet(Node* first, string separator)` |
| 45 | +*Input parameters:* a pointer to the first element of the list, a separator character. |
| 46 | +*Output parameters:* a string containing elements of a set separated by a separator character. |
| 47 | +*Requirements:* there should not be a separator at the end of the result line |
| 48 | +###Deleting a set (clearing the memory occupied by the list) - `Node* deleteSet(Node*& first)` |
| 49 | +*Input parameters:* a pointer to the first item in the list. |
| 50 | +*Output parameters:* a pointer to the first element of the list, equal to NULL. |
| 51 | +____ |
| 52 | +[:arrow_up:Content](#Content) |
| 53 | +____ |
0 commit comments