算法练习
文章平均质量分 59
每天至少两道算法题
请不要在网络上随地大小便!
加油呀!
展开
-
记录KMP学习
KMP算法学习原创 2022-08-19 13:16:15 · 183 阅读 · 0 评论 -
求二叉树的层序遍历
求二叉树的层序遍历原创 2022-08-14 00:49:53 · 96 阅读 · 0 评论 -
扑克牌顺子题
扑克牌顺子题原创 2022-08-07 17:04:53 · 85 阅读 · 0 评论 -
3-1常用排序练习
常用排序练习原创 2022-08-07 17:02:26 · 132 阅读 · 0 评论 -
2-1两数之和
2-1两数之和原创 2022-08-01 11:39:20 · 69 阅读 · 0 评论 -
1-2二分查找
1-2二分查找原创 2022-08-01 10:58:39 · 71 阅读 · 0 评论 -
1-1反转链表
1-1反转链表原创 2022-07-31 11:12:25 · 65 阅读 · 0 评论 -
c++高精度算法学习笔记!
高精度算法的用处?所谓高精度算法就是用来计算很大的数字的运算的算法,在c++中,当一个数字过于庞大,无法用已有的数据类型来表示,就会出现数据溢出的现象,这个时候我们就可以用高精度算法来解决这个问题啦!高精度算法的核心思想?用数组将数据存储起来,再将我们小学学习的加减乘除的步骤用代码表示出来,并将结果存入另一个数组,那计算就算完成啦。高精加法#include<iostream>#include<string.h>using namespace std;string st原创 2021-04-16 15:16:15 · 134 阅读 · 0 评论 -
sort the array
洛谷题目链接Being a programmer, you like arrays a lot. For your birthday, your friends have given you an array aa consisting of nn distinct integers.Unfortunately, the size of aa is too small. You want a bigger array! Your friends agree to give you a bigger a转载 2021-02-28 00:20:50 · 129 阅读 · 0 评论 -
Two Round Dances
One day, n people (n is an even number) met on a plaza and made two round dances, each round dance consists of exactly n/2 people. Your task is to find the number of ways n people can make two round dances if each round dance consists of exactly n/2 peopl.原创 2021-02-26 21:22:56 · 215 阅读 · 0 评论 -
菜鸟是如何理解lowbit()运算的?
首先放上代码:int lowbit(int x){ return x&(-x)}这里用的知识有两点:与运算,pc存储是以补码的形式来存储数的。补码:----负数的补码是原码按位取反加一(符号位不变),正数的原码和补码是一样的。----eg(假设是八位存储):-8的原码是10001000,反码是11110111,补码是11111000lowbit(8)----00001000&11111000=00001000=8----注:此处只有8和-8是十进制数,其余数为二进制l原创 2021-02-02 11:29:58 · 455 阅读 · 0 评论