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
package main | |
import ( | |
"fmt" | |
"golang.org/x/exp/constraints" | |
) | |
type Number interface { | |
constraints.Float | constraints.Integer | constraints.Complex |
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 WeightedQuickUnion { | |
private int[] id; // id[i] = parent of i | |
private int[] sz; // sz[i] = number of objects in subtree rooted at i | |
private int count; // number of components | |
// Create an empty union find data structure with N isolated sets. | |
public WeightedQuickUnion(int N) { | |
count = N; | |
id = new int[N]; | |
sz = new int[N]; |
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 QuickUnion { | |
private int[] id; // id[i] = parent of i | |
private int count; // number of components | |
// instantiate N isolated components 0 through N-1 | |
public QuickUnion(int N) { | |
id = new int[N]; | |
count = N; | |
for (int i = 0; i < N; i++) { | |
id[i] = i; |
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 QuickFind { | |
private int[] id; | |
private int count; | |
public QuickFind(int N) { | |
count = N; | |
id = new int[N]; | |
for (int i = 0; i < N; i++) | |
id[i] = i; | |
} |
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 {connect} from 'react-redux'; | |
import {actions, RootState, selectors} from '../store'; | |
import Map from '../components/Map'; | |
import {IonHeader, IonToolbar, IonButtons, IonMenuButton, IonTitle, IonContent} from '@ionic/react'; | |
import {Location} from '../store/locations/types'; | |
import {Plugins} from '@capacitor/core'; | |
type Props = typeof mapDispatchToProps & ReturnType<typeof mapStateToProps>; | |
const {Geolocation} = Plugins; |
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 * as branches from './actions'; | |
import { ActionType, getType } from 'typesafe-actions'; | |
import { BranchState } from "./types"; | |
const defaultState: BranchState = { | |
branches: [] | |
} | |
export type BranchAction = ActionType<typeof branches>; |
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 MapView from './Map'; | |
import About from './About'; | |
import { IonTabs, IonTabButton, IonIcon, IonLabel, IonRouterOutlet, IonTabBar, IonPage } from '@ionic/react'; | |
import { Route, Redirect } from 'react-router'; | |
import FishesPage from "./FishesPage"; | |
import BranchList from "./BranchList"; | |
import BranchDetail from "./BranchDetail"; | |
import FishDetail from "./FishDetail"; |
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 '@ionic/core/css/core.css'; | |
import '@ionic/core/css/ionic.bundle.css'; | |
import {IonApp} from '@ionic/react'; | |
import store from "./store/store"; | |
import {BrowserRouter as Router, Route} from 'react-router-dom'; | |
import {Provider} from 'react-redux'; | |
import AppStack from "./pages/AppStack"; | |
const App = () => ( |