ICode9

精准搜索请尝试: 精确搜索
  • Leetcode刷题(第238题)——除自身以外数组的乘积2022-03-18 17:05:51

    一、题目 给你一个整数数组 nums,返回 数组 answer ,其中 answer[i] 等于 nums 中除 nums[i] 之外其余各元素的乘积 。 题目数据 保证 数组 nums之中任意元素的全部前缀元素和后缀的乘积都在 32 位 整数范围内。 请不要使用除法,且在 O(n) 时间复杂度内完成此题。 二、示

  • C++ 函数、变量、类命名规范2021-07-26 10:02:49

    1.变量命名 (1)成员变量 在变量名前加上""表示或者“m” 例如: _curValue; _oldValue; 或者用下滑杠连接各个单词。 (2)全局变量 在变量名前加g_ g_curValue (3)静态变量 static int s_initValue; 2.函数命名 void SetValue(); void GetValue(); 类名: C开头,各单词大写,

  • 第二部分:并发工具类21->原子类:无锁工具2021-07-07 15:32:11

    1.原子类 可见性问题,可以通过volatile解决 原子性问题,可以采用互斥锁方案 2.无锁方案 public class Test { AtomicLong count = new AtomicLong(0); void add10K() { int idx = 0; while(idx++ < 10000) { count.getAndIncrement(); } } } count

  • 插入排序算法2021-07-06 23:04:07

    插入排序的核心思想是: 1 向一个已有序的队列中插入数据, n个数,那么只需要插入n-1次 实现如下: 将第一个数看作一个自然有序的队列. #include <iostream> #include <algorithm> using namespace std; void InsertSoft(int* a,int length) { if(a != NULL && length > 0)

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有