In the Java collection framework, there are three similar methods, addAll(),retainAll() and removeAll().  addAll(), the retainAll(), and the removeAll()methods are equivalent to the set theoretic union,  intersection, and complement operators, respec…
[BZOJ2213][Poi2011]Difference Description A word consisting of lower-case letters of the English alphabet ('a'-'z') is given. We would like to choose a non-empty contiguous (i.e. one-piece) fragment of the word so as to maximise the difference in the…
title: [概率论]1-3:组合(Combinatorial Methods) categories: Mathematic Probability keywords: Combination 组合 Binormial Coeffcient 二项式系数 Multinormial Coeffcient 多项式系数 toc: true date: 2018-01-26 9:20:58 Abstract: 本文主要介绍组合的相关知识,以及引出的二项式系数,多项式系数 Keywords: Combi…
[Description] A queue is a collection that implements the first-in-first-out protocal. This means that the only accessiable object in the collection in the first one that was inserted. The most common example of a queue is a waiting line. [Interface]…
[Description] At ree is a nonlinear data structure that models a hierarchical organization. The characteristic eatures are that each element may have several successors (called its "children") and every element except one (called the "root&…
Statements: This blog was written by me, but most of content  is quoted from book[Data Structure with Java Hubbard] [Description] This simulationillustrates objectoriented programming(OOP). Java objects are instantiated to represent all the interacti…
Last night it took me about two hours to learn arrays. For the sake of less time, I did not put emphaises on the practice question, just now when reading the book, I found that some methods referred to arrays are so beneficial to us. So in here make…
Method 1: Add one list into the other list. For example, if list1is {22, 33, 44, 55} and  list2 is {66, 77, 88, 99},then append(list1, list2)will change list1to {22, 33, 44, 55, 44, 66, 77, 88, 99}. static void append(Node list1, Node list2) { if (li…
Method 4: Gets the value of element number i For example, if list is {22, 33, 44, 55, 66, 77, 88, 99}, then get(list, 2) will return 44. Solution 1: static int get(Node list, int i) { if (i < 0) { throw new IllegalArgumentException(); } for (int j =…
/** * Method 1: Delete the input element x  * and meanwhile keep the length of array after deleted n * @param a  the array * @param n  the length of array after deleted. * @param x  the element that need to be deleted. */ static void delete(int[] a,…