What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-03-15 06:55:06
segment tree complexity
// C++ program to show segment tree operations like construction, query // and update #include <bits/stdc++.h> using namespace std; // A utility function to get the middle index from corner indexes. int getMid(int s, int e) { return s + (e -s)... Add solution -
C++ 2022-02-24 11:00:27
get index of value c++
vector<int> arr = { 6, 3, 5, 2, 8 }; vector<int>::iterator itr = std::find(arr.begin(), arr.end(), elem); if (itr != end(arr)) { cout << "Element " << elem << " is present at index " << distance(ar... Add solution -
Java 2021-11-21 16:51:20
Reverse an array in java using for loop
// Reverse an array in java using for loop public class ReverseArrayUsingForLoop { public static void main(String[] args) { int[] arrNumbers = new int[]{2, 4, 6, 8, 10}; System.out.println("Given array: "); for(int ... Add solution -
TypeScript 2021-11-20 05:38:11
longest increasing subsequence when elements hae duplicates
#include <iostream> #include <algorithm> using namespace std; // define maximum possible length of X and Y #define N 20 // lookup[i][j] stores the length of LCS of subarray X[0..i-1], Y[0..j-1] int lookup[N][N]; // Functio... Add solution -
Other 2021-11-18 09:57:08
longest increasing subsequence techie delight
#include <iostream> #include <vector> using namespace std; // Iterative function to find longest increasing subsequence // of given array void findLIS(int arr[], int n) { // LIS[i] stores the longest increasing s... Add solution -
C 2021-10-16 12:09:12
Segment tree
// C++ program to show segment tree operations like construction, query // and update #include <bits/stdc++.h> using namespace std; // A utility function to get the middle index from corner indexes. int getMid(int s, int e) { return s + (e -s)... Add solution -
Java 2021-10-11 13:35:15
ArrayList subList(int fromIndex, int toIndex) method in java
import java.util.ArrayList; import java.util.List; public class ArrayListSubListMethodExample { public static void main(String[] args) { try { ArrayList<String> al = new ArrayList<String>(); al.add("ora... Add solution -
Java 2021-10-07 19:08:15
how to quicksort a string array in java
package com.javacodegeeks.sorting.quicksort; public class QuicksortStringExample { private static String []a; public static void main(String[] args) { ... Add solution -
C# 2021-09-28 10:31:01
C# Program For Check Total Occurrence Of A Number In An Array
using System; using System.Linq; namespace CheckOccurrenceOfNumberInArray { class Program { static void Main(string[] args) { int[] array = { 1, 20, 15, 23, 15, 14, 26, 188,175,12, 36, 78, 15, 3, 5, 91... Add solution