Skip to content

Commit 286070c

Browse files
authored
Laboratory work 1
1 parent 350a951 commit 286070c

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
Laboratory work on an academic subject: "Programming dynamic data structures"
33
____
44
## 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)`)
5+
1. [Laboratory work 1](#l1)
6+
1.1. [Creating an empty set](#l11)
7+
1.2. [Checking for an empty set](#l12)
8+
1.3. [Checking whether an element belongs to a set](#l13)
9+
1.4. [Adding a new element to the set](#l14)
10+
1.5. [The power of the set](#l15)
11+
1.6. [Creating a set](#l16)
12+
1.7. [Output of elements of the set](#l17)
13+
1.8. [Deleting a set (clearing the memory occupied by the list)](#l18)
1414
____
1515
## Laboratory work 1. Creating functions that implement operations for creating work with sets
16+
<a name="l1"></a>
1617
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
1718

1819
| File name | File Contents |
@@ -22,30 +23,38 @@ A singly connected list of integer values is used to represent the set. OOP is n
2223
| SetLab1_12_Kudashov.cpp | Function set implementation file |
2324

2425
### Creating an empty set - `Node* creatingAnEmptySet()`
26+
<a name="l11"></a>
2527
*Input parameters:* None.
2628
*Output parameters:* a pointer to the first element of the list, equal to NULL.
2729
### Checking for an empty set - `bool emptySet(Node* first)`
30+
<a name="l12"></a>
2831
*Input parameters:* a pointer to the first item in the list.
2932
*Output parameters:* Boolean value.
3033
### Checking whether an element belongs to a set - `bool checkingOfExistence(Node* first, int checking_value)`
34+
<a name="l13"></a>
3135
*Input parameters:* a pointer to the first element of the list, the value of the element.
3236
*Output parameters:* Boolean value.
3337
### Adding a new element to the set - `Node* add(Node*& first, int adding_value)`
38+
<a name="l14"></a>
3439
*Input parameters:* a pointer to the first element of the list, a value to be added to the list.
3540
*Output parameters:* a pointer to the first element of the result list.
3641
*Restriction:* Adding an item to the top of the list.
3742
### The power of the set - `int powerOfTheSet (Node* first)`
43+
<a name="l15"></a>
3844
*Input parameters:* a pointer to the first item in the list.
3945
*Output parameters:* integer value.
4046
### Creating a set - `Node* creatingSet(int quantity, int min, int max, int k)`
47+
<a name="l16"></a>
4148
*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.
4249
*Output parameters:* a pointer to the first element of the result list. Generation of values by a random number sensor.
4350
*Requirement:* check the possibility of creating a set with the specified parameters.
4451
### Output of elements of the set - `string printSet(Node* first, string separator)`
52+
<a name="l17"></a>
4553
*Input parameters:* a pointer to the first element of the list, a separator character.
4654
*Output parameters:* a string containing elements of a set separated by a separator character.
4755
*Requirements:* there should not be a separator at the end of the result line
4856
### Deleting a set (clearing the memory occupied by the list) - `Node* deleteSet(Node*& first)`
57+
<a name="l18"></a>
4958
*Input parameters:* a pointer to the first item in the list.
5059
*Output parameters:* a pointer to the first element of the list, equal to NULL.
5160
____

0 commit comments

Comments
 (0)