摘要:
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer... 阅读全文
摘要:
Given an array of integers and an integerk, find out whether there there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and the d... 阅读全文
摘要:
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matr... 阅读全文
摘要:
归并排序原理即将两个有序的数组合并成一个,归并排序有两种方法:递归和循环。/*递归方法*/void Merge(int TR1[], int TR2[], int low, int mid, int high){//将TR2归并入TR1中 int pos1 = low; int pos2 = mid... 阅读全文