算法 第4页
令人头疼的算法,算法竞赛冲啊
【算法】【Python】蓝桥杯Python组比赛技巧 - AI科研 编程 读书笔记 - 小竹の笔记本

【算法】【Python】蓝桥杯Python组比赛技巧

本文介绍了Python在蓝桥杯比赛中的常用技巧,包括序列翻转、数字进制转换、数学表达式解析、自定义排序、遍历序列、数据结构操作、组合与排列生成、双端队列、阶乘计算、日期处理、字符计数、有...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo5个月前
09014
【递归】斐波那契数 - AI科研 编程 读书笔记 - 小竹の笔记本

【递归】斐波那契数

#include<iostream> using namespace std; int fib(int n){ if (n<2){ return n; } return fib(n-1) + fib(n-2); } int main(){ int n; cin >> n; cout << fib(n); return 0; } 数...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
015515
【C】二维数组每行冒泡排序 - AI科研 编程 读书笔记 - 小竹の笔记本

【C】二维数组每行冒泡排序

void sort2D(int arr[][cols], int rows, int cols) {    int temp;    for (int i = 0; i < rows; i++) {        for (int j = 0; j < cols - 1; j++) {            for (...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo2年前
03866
【算法】十大排序算法的方法与C语言+Python实现 - AI科研 编程 读书笔记 - 小竹の笔记本

【算法】十大排序算法的方法与C语言+Python实现

本文总结一下我在算法课程中学习到的十大排序算法思路和C语言+Python实现。
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo6个月前
01157
【C】合并有序数组 - AI科研 编程 读书笔记 - 小竹の笔记本

【C】合并有序数组

#include <stdio.h> int main(){ int M,N; int a[]={1,3,5,6,8},b[]={1,2,5,7,8,9}; M=sizeof(a)/sizeof(a[0]); N=sizeof(b)/sizeof(b[0]); int c[M+N]; int i=0,j=0,k=0; //当有任何一个数...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
012411
【模拟】二进制求和 - AI科研 编程 读书笔记 - 小竹の笔记本

【模拟】二进制求和

#include <iostream> using namespace std; string addBinary(string a, string b){ string res; int carry = 0;  // 进位 int i = a.size() - 1; int j = b.size() - 1; while(i >= 0 || j...
SmallBamboo的头像 - AI科研 编程 读书笔记 - 小竹の笔记本SmallBamboo1年前
014314