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
| import React from 'react'; | |
| import { Text, View } from 'react-native'; | |
| const AlbumList = () => ( | |
| <View> | |
| <Text> AlbumList </Text> | |
| </View> | |
| ); | |
| export default AlbumList; |
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
| 1. build a heap 1, 2, 4, 5, 3, 6 | |
| 2. turn this heap into a sorted list | |
| deleteMin | |
| 1, 2, 4, 5, 3, 6 swap 1 and 6 | |
| 6, 2, 4, 5, 3, 1 restore heap | |
| 2, 6, 4, 5, 3, 1 | |
| 2, 3, 4, 5, 6, 1 | |
| deleteMin |
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
| //The following code example demonstrates the algorithm | |
| public void insert(Comparable x) | |
| { | |
| if(size == heap.length - 1) doubleSize(); | |
| //Insert a new item to the end of the array | |
| int pos = ++size; | |
| //Percolate up |
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
| public class minHeap { | |
| public int size; | |
| public int [] mH; | |
| public int position; | |
| public minHeap(int size){ | |
| this.size=size; | |
| mH = new int [size+1]; | |
| position = 0; | |
| } | |
| public void createHeap(int [] arrA){ |
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
| /* Deleting a node from Binary search tree */ | |
| #include<iostream> | |
| using namespace std; | |
| struct Node { | |
| int data; | |
| struct Node *left; | |
| struct Node *right; | |
| }; | |
| //Function to find minimum in a tree. | |
| Node* FindMin(Node* root) |
NewerOlder