1.直接插入排序算法 源码: package com.DiYiZhang;/* 插入排序算法 * 如下进行的是插入,排序算法*/ public class InsertionSort { public static void insertionSort(int[] a) { int tmp; for (int i = 1; i < a.length; i++) { for (int j = i; j >0; j--) { …
Where is the Marble? Descriptions: Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would place the marbles one after another in ascending order of the numbers written on th…
1.给两个字符串s和t,判断t是否为s的重新排列后组成的单词. s = "anagram", t = "nagaram", return true. s = "rat", t = "car", return false. leetcode地址:https://leetcode.com/problems/valid-anagram/description/ (1)解法一:排序,O(n*logn) class Solution:…