This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import Counter | |
| import heapq | |
| class Elements(): | |
| def __init__(self, key: int, val: int): | |
| super().__init__() | |
| self.key = key | |
| self.val = val | |
| def __repr__(self): | |
| return f'Key: {self.key}, Val: {self.val}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function doOnCurrentPageChanged(survey) { | |
| document | |
| .getElementById('surveyPrev') | |
| .style | |
| .display = !survey.isFirstPage | |
| ? "inline" | |
| : "none"; | |
| document | |
| .getElementById('surveyNext') | |
| .style |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Assume all vertices are serial integers from 0 to V | |
| V = 10 | |
| # Create Adjacency matrix. Fill all elements with zeros | |
| # **Remember Adjacency matrix is just a 2D array | |
| adj_matrix = [[0 for _ in range(V)] for _ in range(V)] | |
| # Lets bring in edges. They are a list with first element pointing to second | |
| edges = [[0,5], [1,2], [1,4], [1,5], [2,6], [3,7], [4,9]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set no. of vertices. Assume all vertices are serial integers from 0 to V | |
| V = 10 | |
| # Create Adjacency matrix. Fill all elements with zeros | |
| # **Remember Adjacency matrix is just a 2D array | |
| adj_matrix = [[0 for _ in range(V)] for _ in range(V)] | |
| # Lets bring in edges. They are a list with first element pointing to second | |
| edges = [[0,5], [1,2], [1,4], [1,5], [2,6], [3,7], [4,9]] |