0% found this document useful (0 votes)
192 views

CS2040 CheatSheet

To reverse a data structure like a priority queue, use Collections.reverseOrder() comparator; to reverse a list, use Collections.reverse() which only works for lists. Graph coloring is a useful technique for solving graph problems.

Uploaded by

789ianwong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
192 views

CS2040 CheatSheet

To reverse a data structure like a priority queue, use Collections.reverseOrder() comparator; to reverse a list, use Collections.reverse() which only works for lists. Graph coloring is a useful technique for solving graph problems.

Uploaded by

789ianwong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

SSSP Problem

1. To reverse a data structure, use Collections.reverseOrder() to return a


comparator to be used.
* e.g. new PriorityQueue<>(Collections.reverseOrder())

2. To reverse a list, use Collections.reverse()


* Note that this only works for list!

3. Graph colouring can be a very useful technique in solving graph


problems!

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy