Website Summary Files Commits Branches @commit @diff @stats
path: root / Practicum / pract09
diff options
context:
space:
mode:
Commit5bbc0e54941060fa118956ac0bee417e6ea66963 (patch)
Author
 Desislava Shunina <115353472+desiish@users.noreply.github.com>
2024-12-03 17:57:44 +0200
Committer
 GitHub <noreply@github.com>
2024-12-03 17:57:44 +0200
Files647260aa82c8613ba1db8724bccd0cdf3c91589b /Practicum/pract09
Data-structures-and-algorithms-5bbc0e54941060fa118956ac0bee417e6ea66963.tar
Data-structures-and-algorithms-5bbc0e54941060fa118956ac0bee417e6ea66963.tar.gz
Data-structures-and-algorithms-5bbc0e54941060fa118956ac0bee417e6ea66963.zip
Parentc6aac99a845c7787496611fd0bb7c4be55e916ed (diff)
Update readme.md
1 files changed, 4 insertions, 4 deletions
-rw-r--r--Practicum/pract09/readme.md8
diff --git a/Practicum/pract09/readme.md b/Practicum/pract09/readme.md
index ea04332..3a760cd 100644
--- a/Practicum/pract09/readme.md
+++ b/Practicum/pract09/readme.md
@@ -53,7 +53,7 @@ void heapify(RandomIt first, size_t rootIdx, size_t size, Compare comp) {
template <typename RandomIt, typename Compare = std::less<>>
void make_heap(RandomIt first, RandomIt last, Compare comp = Compare()) {
- size_t size = last - first;
+ size_t size = last - first; // should use std::dist for when its not vector
for (int i = size / 2; i >= 0; --i)
heapify(first, i, size, comp);
@@ -74,7 +74,7 @@ void bubble_up(RandomIt first, size_t index, Compare comp) {
template <typename RandomIt, typename Compare = std::less<>>
void push_heap(RandomIt first, RandomIt last, Compare comp = Compare()) {
- size_t size = last - first;
+ size_t size = last - first; // should use std::dist for when its not vector
if (size > 1)
bubble_up(first, size - 1, comp);
@@ -82,7 +82,7 @@ void push_heap(RandomIt first, RandomIt last, Compare comp = Compare()) {
template <typename RandomIt, typename Compare = std::less<>>
void pop_heap(RandomIt first, RandomIt last, Compare comp = Compare()) {
- size_t size = last - first;
+ size_t size = last - first; // should use std::dist for when its not vector
if (size > 1) {
std::swap(*first, *(last - 1));
@@ -92,7 +92,7 @@ void pop_heap(RandomIt first, RandomIt last, Compare comp = Compare()) {
template <typename RandomIt, typename Compare = std::less<>>
bool is_heap(RandomIt first, RandomIt last, Compare comp = Compare()) {
- size_t size = last - first;
+ size_t size = last - first; // should usestd:: dist for when its not vector
for (size_t i = 0; i < size / 2; ++i) {
size_t leftChild = 2 * i + 1;