Skip to content

Conversation

melihakpinar
Copy link
Contributor

Copy link
Member

@kayacanv kayacanv left a comment

Choose a reason for hiding this comment

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

The overleaf link does not allow me to left comments on the document.
I have comments about the changes can be made on the document, I can comment on where you should review/change

If and only if for all sufficiently large values of x, the absolute value of $f(x)$ is at most a positive constant multiple of $g(x)$. That is, $f(x)$ = $O(g(x))$ if and only if there exists a positive real number M and a real number $x_0$ such that: \\
$$|f(x)| \leq Mg(x)\ for \ all\ x\ such\ that\ x_0 \leq x$$
In many contexts, the assumption that we are interested in the growth rate as the variable x goes to infinity is left unstated, and one writes more simply that:
In many contexts, the assumption that we are interested in the growth rate as the variable $x$ goes to infinity is left unstated, and one writes more simply that:
Copy link
Member

Choose a reason for hiding this comment

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

I think this sentences is verry complex, it can be simplified

priority_queue<int> pq;

for(int i = 0 ; i < 5 ; i ++){
pq.push(i);
Copy link
Member

Choose a reason for hiding this comment

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

this looks like stack implementation, not PQ implementation. You should put more complex code in here,
instead of 0 to 5. putting random values, works better.
https://www.geeksforgeeks.org/efficient-way-to-initialize-a-priority-queue/

cout << pq.top() << " ";
pq.pop();
}
// 4 3 2 1 0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// 4 3 2 1 0
// Output: 4 3 2 1 0


\textbf{C++:} They are no different than stack, queue and deque we already know. It provides the implementation, you can simply include the libraries and use them. See \href{http://www.cplusplus.com/reference/queue/queue/}{queue}, \href{http://www.cplusplus.com/reference/stack/stack/}{stack}, \href{http://www.cplusplus.com/reference/deque/deque/}{deque}

\subsection{Priority Queues}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
\subsection{Priority Queues}
\subsection{Priority Queues & Heaps}

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.

2 participants