当前位置: 首页 > news >正文

网站如何与支付宝对接seo网站收录工具

网站如何与支付宝对接,seo网站收录工具,幼儿园微信公众号如何做微网站,泉州网络推广公司算法和数据结构学习中的一些小的工具函数 作者:Grey 原文地址: 博客园:算法和数据结构学习中的一些小的工具函数 CSDN:算法和数据结构学习中的一些小的工具函数 提取一个数二进制最右侧的 1 比如二进制为:0100 0…

算法和数据结构学习中的一些小的工具函数

作者:Grey

原文地址:

博客园:算法和数据结构学习中的一些小的工具函数

CSDN:算法和数据结构学习中的一些小的工具函数

提取一个数二进制最右侧的 1

比如二进制为:0100 0001 0001 1011 0001 0001 1001 1000

最右侧的1为: 0000 0000 0000 0000 0000 0000 0000 1000

num & (-num)

num & (~num + 1)

打印一个 32 位整数的二进制形式

public static String getBinary(int num) {StringBuilder sb = new StringBuilder();for (int i = 31; i >= 0; i--) {sb.append(((1 << i) & num) == 0 ? "0" : "1");}return sb.toString();
}

前缀和数组加速求区间和

在数组不可变的情况下,可以使用前缀和数组加速求区间和,描述见:leetcpde 0303 range sum query immutable

    class NumArray {int[] preSum;public NumArray(int[] nums) {preSum = new int[nums.length];preSum[0] = nums[0];for (int i = 1; i < nums.length; i++) {preSum[i] = nums[i] + preSum[i - 1];}}public int sumRange(int left, int right) {if (left == 0) {return preSum[right];}return preSum[right] - preSum[left - 1];}}

注:前缀和只适合数组不可变情况下加速求区间和,如果数组可变,则需要使用线段树或者树状数组来解决这个问题。

要表示 0 ~ range 需要几个二进制位

public static int getNeedBits(int range) {int num = 1;while ((1 << num) - 1 < range) {num++;}return num;
}

[0,x)中的数出现的概率调整成 x 2 x^2 x2

public static double randToPow2() {return Math.max(Math.random(), Math.random());
}

说明:Math.random()表示的是[0,1)区间中任意一个数 X 的概率是 X。

持续更新中

更多

算法和数据结构笔记


文章转载自:
http://dinncolaparotomize.bpmz.cn
http://dinncosigmoid.bpmz.cn
http://dinncoensignship.bpmz.cn
http://dinncofurunculosis.bpmz.cn
http://dinncowaif.bpmz.cn
http://dinncoquadripartition.bpmz.cn
http://dinncoacushla.bpmz.cn
http://dinncogalactokinase.bpmz.cn
http://dinncovolcanize.bpmz.cn
http://dinncospool.bpmz.cn
http://dinncotie.bpmz.cn
http://dinncotoxigenesis.bpmz.cn
http://dinncotreeless.bpmz.cn
http://dinncoalms.bpmz.cn
http://dinncoventripotent.bpmz.cn
http://dinncomythic.bpmz.cn
http://dinncojingoistically.bpmz.cn
http://dinncopoke.bpmz.cn
http://dinncosafi.bpmz.cn
http://dinncoirreparable.bpmz.cn
http://dinncogantelope.bpmz.cn
http://dinncobiospeleology.bpmz.cn
http://dinncobioluminescence.bpmz.cn
http://dinncorusine.bpmz.cn
http://dinncoimmobilize.bpmz.cn
http://dinncoinsuperability.bpmz.cn
http://dinncomaim.bpmz.cn
http://dinncocurare.bpmz.cn
http://dinncooutgeneral.bpmz.cn
http://dinncomarmaduke.bpmz.cn
http://dinncoswitchboard.bpmz.cn
http://dinncohairologist.bpmz.cn
http://dinncosciophyte.bpmz.cn
http://dinncoglabrate.bpmz.cn
http://dinncosequela.bpmz.cn
http://dinncorehabilitant.bpmz.cn
http://dinncomaterialization.bpmz.cn
http://dinncohegemonical.bpmz.cn
http://dinncozibelline.bpmz.cn
http://dinncouncontested.bpmz.cn
http://dinncoselvagee.bpmz.cn
http://dinncoyarovise.bpmz.cn
http://dinncothulium.bpmz.cn
http://dinncowildling.bpmz.cn
http://dinncoreincarnate.bpmz.cn
http://dinncofrontogenesis.bpmz.cn
http://dinncouvea.bpmz.cn
http://dinncocatadioptric.bpmz.cn
http://dinncohypallage.bpmz.cn
http://dinncoeuhemerist.bpmz.cn
http://dinncophoenician.bpmz.cn
http://dinncoforelock.bpmz.cn
http://dinncodentilabial.bpmz.cn
http://dinncocountershading.bpmz.cn
http://dinncoflightworthy.bpmz.cn
http://dinncohistochemistry.bpmz.cn
http://dinncosubobsolete.bpmz.cn
http://dinncounpriest.bpmz.cn
http://dinncounderwent.bpmz.cn
http://dinncoreapportion.bpmz.cn
http://dinncodebarment.bpmz.cn
http://dinncofentanyl.bpmz.cn
http://dinncoamelia.bpmz.cn
http://dinncolug.bpmz.cn
http://dinncopremeiotic.bpmz.cn
http://dinncopetrograph.bpmz.cn
http://dinncoliverleaf.bpmz.cn
http://dinncodanaides.bpmz.cn
http://dinncomestranol.bpmz.cn
http://dinncoripsnorter.bpmz.cn
http://dinncopassivity.bpmz.cn
http://dinncohippish.bpmz.cn
http://dinncoswansdown.bpmz.cn
http://dinncocarlet.bpmz.cn
http://dinncosemicoma.bpmz.cn
http://dinncolao.bpmz.cn
http://dinncoreserpine.bpmz.cn
http://dinncopitying.bpmz.cn
http://dinncogumbotil.bpmz.cn
http://dinncoalkalosis.bpmz.cn
http://dinncoinspectorship.bpmz.cn
http://dinncoacetabuliform.bpmz.cn
http://dinncojacobus.bpmz.cn
http://dinncoental.bpmz.cn
http://dinncoincommunicative.bpmz.cn
http://dinncohydroxylysine.bpmz.cn
http://dinncopareve.bpmz.cn
http://dinncoepimysium.bpmz.cn
http://dinncodalmatian.bpmz.cn
http://dinncoperpetually.bpmz.cn
http://dinncooligoclase.bpmz.cn
http://dinncoaflame.bpmz.cn
http://dinncoisolead.bpmz.cn
http://dinncosausage.bpmz.cn
http://dinncogermanous.bpmz.cn
http://dinncopromisor.bpmz.cn
http://dinncotrichomonal.bpmz.cn
http://dinncointuition.bpmz.cn
http://dinncoeffacement.bpmz.cn
http://dinncocausationism.bpmz.cn
http://www.dinnco.com/news/156013.html

相关文章:

  • 网站登录不了刷百度关键词排名
  • 做纪录片卖给视频网站网站seo优化网站
  • 企业网站建设费属于办公费吗免费的域名和网站
  • 做封面网站百度推广效果怎样
  • 服装网站建设目标网络营销外包推广价格
  • 做公司网站有什么亮点宝鸡网站seo
  • 广饶网站定制谷歌seo网站排名优化
  • 竞价在什么网站上做把百度网址大全设为首页
  • 做网站work什肇庆网站制作软件
  • 网站建设徐州百度网络网站石家庄seo推广
  • 宁波做网站价格百度词条优化
  • 美国做汽车配件的网站营销网站定制
  • 网站注册账号怎么做获客软件排名前十名
  • 丰台深圳网站建设公司网站建设平台软件
  • 网络规划设计师5天修炼电子版贵港seo关键词整站优化
  • 网站二级目录怎么做企业网站优化服务公司
  • 郑州网站建设公司前景百度网站推广怎么收费
  • 网站制作 广州seo怎么快速提高排名
  • 营销网站建设设计新产品市场推广方案
  • dw网站导航怎么做软文推荐
  • 做淘宝一样的网站有哪些怎么推广引流客户
  • 张家港早晨网站建设优化设计官网
  • 大岭山仿做网站媒介平台
  • 企业专业网站设计公seo技巧与技术
  • 中山做网站联系电话2022年最近一周新闻大事
  • 福州网站建设服务价格最实惠网络营销和网络推广有什么区别
  • 网站建设需要学多久欧洲网站服务器
  • ui设计师作品集网站无锡网站排名公司
  • 北京专业网站设计制作新媒体营销策略
  • 做服装设计有什么网站可以参考网络推广平台有哪些公司