![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法篇
JingChen23
这个作者很懒,什么都没留下…
展开
-
C++数据交换速度测试(按位异或vs普通交换):
C++数据交换速度测试(按位异或vs普通交换):普通交换法这种方法的原理是搬运include <iostream> using namespace std; int main() { int a = 7; int b = 4; int t; for (int i = 0;i<1000000000;i++) {原创 2017-05-10 14:04:14 · 715 阅读 · 3 评论 -
Container With Most Water
container with most water原创 2017-05-27 20:22:13 · 225 阅读 · 0 评论 -
Java和C++在函数参数传递上的不同
故事的起源起源于在leetcode上面刷题,刷到第39题Combination Sum。 Combination Sum 这道题是一道经典的回溯问题,一个被票选为最佳答案的解决方案如下:public class Solution { public List<List<Integer>> combinationSum(int[] nums, int target) { Li原创 2017-05-20 14:08:51 · 310 阅读 · 0 评论 -
最优雅的堆排序Java实现
public class HeapSort { public int[] sort (int[] nums){ for (int i = 0; i &lt; nums.length; i++){ int j = i; int parent = (j-1)/2; while (j&gt;0 &amp;&a...原创 2018-10-07 14:13:32 · 152 阅读 · 0 评论