代码收集
文章平均质量分 75
Good_night_Sion_
Good Night, Sion.
展开
-
O(1)计算一个二进制数1的个数以及反转一个二进制数
代码引自:http://blog.csdn.net/metalseed/article/details/8045038 inline int count_bits(int x){ x = (x & 0x55555555) + ((x & 0xaaaaaaaa) >> 1); x = (x & 0x33333333) + ((x & 0xcccccccc) >> 2);转载 2016-11-13 13:59:46 · 960 阅读 · 6 评论 -
Range Minimum Query and Lowest Common Ancestor 区间最值查询和最近公共祖先问题
写在前面的话: 本文原地址来自https://www.topcoder.com/community/data-science/data-science-tutorials/range-minimum-query-and-lowest-common-ancestor/,原作者为danielp。若侵犯了相关权益,本文删除 本文纯手动翻译,因为感觉有些网上的翻译实在是翻译 2017-05-19 11:36:18 · 629 阅读 · 1 评论