Instantly share code, notes, and snippets.

Bhishmarajbhi5hmaraj

• Sort options
Created Jul 12, 2018
View blog.html


Today I want to introduce you some very very useful data structures.

In this lecture, we are trying to improve your data structures skills, stay with us and click on read more. Important data structures :

Trees

Trees are one of the most useful data structures.A tree is a connected-acyclic graph.There are too many types of trees, like : rooted trees, weighted trees, directed trees, tries, etc.

Partial sum

There are two types of problems solvable by partial sum.

1.Problems which you are asked to answer some queries about the sum of a part of elements (without modify queries).

Solution of all of this problems are the same. You just need to know how to solve one of them.

Example : You are asked some queries on an array a1, a2, ...a, n

Created Jul 9, 2018
View Template.java
 import java.util.*; import java.io.*; class { public static void main(String args[]) { FastScanner scan =new FasrScanner(); PrintWriter out=new PrintWriter(new BufferedOutputStream(System.out), true); //Close the output stream after use int t= scan.nextInt();
Created Jul 2, 2018
View timus_1523.java
 import java.util.*; import java.io.*; public class timus_1523 { /************************ SOLUTION STARTS HERE ************************/ static final int MOD = (int) 1e9;
Created Jan 2, 2018
Naive O(N^2) DP solution
View GuardiansoftheLunaticsVol2.java
 import java.util.*; import java.io.*; public class GuardiansoftheLunaticsVol2 { /************************ SOLUTION STARTS HERE ************************/ static long memo[]; static long pref[];
Created Dec 21, 2017
View ETFS.java
 import java.util.*; import java.io.*; class ETFS { /************************ SOLUTION STARTS HERE ************************/ static int primes[]; static final int MAX = (int) 1e7;
Created Dec 2, 2017
View LA_5117.java
 import java.util.*; import java.io.*; public class LA_5117 { /************************ SOLUTION STARTS HERE ************************/ static class MM { // MM (Modular Math) class
Last active Nov 11, 2017
AC code
View LA_5116.java
 import java.util.*; import java.io.*; public class LA_5116 { /************************ SOLUTION STARTS HERE ************************/ static int P; static int primes[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67};
Created Oct 10, 2017
View FacelessArya.java
 import java.util.*; import java.io.*; public class FacelessArya { /************************ SOLUTION STARTS HERE ************************/ static int MAX = (int) 1e6;
Created Sep 5, 2017
View LA_5108.java
 import java.util.*; import java.io.*; public class LA_5108 { /************************ SOLUTION STARTS HERE ************************/ static double pt[][];
Last active Sep 1, 2017
View uva_12546.java
 import java.util.*; import java.io.*; public class uva_12546 { /************************ SOLUTION STARTS HERE ************************/ static final int mod = 1000000007; static final int modInv2 = 500000004; // 2^-1
You can’t perform that action at this time.