Skip to content

Implementation of Priority Queue#2

Merged
minnce merged 14 commits intomainfrom
Tree
Apr 13, 2025
Merged

Implementation of Priority Queue#2
minnce merged 14 commits intomainfrom
Tree

Conversation

@minnce
Copy link
Copy Markdown
Owner

@minnce minnce commented Apr 11, 2025

No description provided.

@minnce minnce requested a review from lc10934 April 11, 2025 23:43
Comment thread src/Data_Structures/Priority_Queue.hpp Outdated
{
size_t left = currInd * 2 + 1;
size_t right = currInd * 2 + 2;
T newLargest = currInd;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newLargest is an index so should be type size_t

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

@minnce minnce closed this Apr 12, 2025
@minnce minnce reopened this Apr 12, 2025
}

const T &pop_front()
T pop_front()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct change

Comment thread src/Data_Structures/Priority_Queue.hpp Outdated
size_t size() const { return sz; }

private:
void refactor(size_t currInd)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if refactor is a great name for this but up to you

Comment thread src/Data_Structures/Priority_Queue.hpp Outdated
maxSz = newSize;
}

std::unique_ptr<T[]> tree;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simiar thing here, id probably use a std::array instead fo a C style array

Comment thread src/Data_Structures/Priority_Queue.hpp Outdated
private:
void refactor(size_t currInd)
{
size_t left = currInd * 2 + 1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing some const

@minnce minnce merged commit 95e640a into main Apr 13, 2025
3 checks passed
@minnce minnce deleted the Tree branch April 13, 2025 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants