What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-06 16:25:02
React native icon spin
import React, { useEffect } from 'react'; import { View, StyleSheet, Animated, Easing } from 'react-native'; import { FontAwesome } from '@expo/vector-icons'; const Spinner = () => { const spinValue = new Animated.Value(0); useEffect(() => { ... Add solution -
Python 2021-09-06 12:43:03
Decision tree learning algorithm for regression
# Decision tree learning algorithm for regression from pyspark.ml.linalg import Vectors df = spark.createDataFrame([ (1.0, Vectors.dense(1.0)), (0.0, Vectors.sparse(1, [], []))], ["label", "features"]) dt = DecisionTreeRegressor(m... Add solution -
C++ 2021-09-06 07:14:03
implemetation of priority queue in c++
// Implementation of priority_queue in c++ //queue with elements in decreasing order priority_queue<int> pq; // queue with elements in increasing order using compare function inside declaration priority_queue <int, vector<int>, greater&l... Add solution -
C++ 2021-09-06 06:48:02
monotonic deque
deque<int> dq; vector<int> ans; for (int i=0; i<nums.size(); i++) { if (!dq.empty() && dq.front() == i-k) dq.pop_front(); while (!dq.empty() && nums[dq.back()] < nums[i]) dq.pop_back(); dq.push_back(i); if (i>=k-1) ans... Add solution