study_2
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| study_2 [2020/06/22 15:59] – jrseti | study_2 [2020/11/03 21:32] (current) – jrseti | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===Binary Heaps=== | + | =====One hour interview Video==== |
| + | |||
| + | https:// | ||
| + | |||
| + | ====Binary Heaps==== | ||
| [[https:// | [[https:// | ||
| Line 5: | Line 9: | ||
| enqueue or dequeue items in O(logn) | enqueue or dequeue items in O(logn) | ||
| - | Priority Queues use a min heap or max heap | + | **Priority Queues** use a min heap or max heap. In Java use the Comparator: |
| + | |||
| + | < | ||
| + | import java.util.*; | ||
| + | |||
| + | ... | ||
| + | PriorityQueue< | ||
| + | ... | ||
| + | |||
| + | |||
| + | Class StudentComparator implements Comparator< | ||
| + | |||
| + | // Overriding compare()method of Comparator | ||
| + | // for descending order of cgpa | ||
| + | public int compare(Student s1, Student s2) { | ||
| + | if (s1.cgpa < s2.cgpa) | ||
| + | return 1; | ||
| + | else if (s1.cgpa > s2.cgpa) | ||
| + | return -1; | ||
| + | return 0; | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| - | ===Reverse Singly Linked List=== | + | ====Reverse Singly Linked List==== |
| prev = None | prev = None | ||
| Line 21: | Line 47: | ||
| - | ==Reverse Double Linked List== | + | ====Reverse Double Linked List==== |
| < | < | ||
| void reverse() { | void reverse() { | ||
| Line 44: | Line 70: | ||
| </ | </ | ||
| - | ==Power Sets== | + | ====Power Sets==== |
| All combinations of letters in a string. | All combinations of letters in a string. | ||
| Line 75: | Line 101: | ||
| </ | </ | ||
| - | ==Tries== | + | ====Tries==== |
| - | ==N Choose K== | + | ====N Choose K==== |
| n!/ | n!/ | ||
| - | ==Knapsack== | + | ====Knapsack==== |
| - | ==Coins== | + | ====Coins==== |
| - | ==Quick Sort== | + | ====Quick Sort==== |
| - | ==Heaps== | + | ====Heaps==== |
| - | ==Spiral== | + | ====Spiral==== |
| - | ==Quick Sort== | + | ====Quick Sort==== |
| - | ==Priority Queues== | + | ====Priority Queues==== |
study_2.1592841550.txt.gz · Last modified: 2020/06/22 15:59 by jrseti