algorithm_51CTO博客
Algorithm】Sorting Algorithm 目录 对比排序 冒泡排序Bubble Sort 归并排序Merge Sort 快速排序Quick Sort 线性排序 计数排序Count Sort 桶排序Bucket Sort 对比排序 Bubble Sort /* * 冒泡排序:重复得走过 ...
转载 2021-10-10 19:39:00
110阅读
2评论
For example we have the array like this: First step is using Counting sort for last digit, in our example is: Then sort according to the last digit: T
转载 2019-03-14 15:45:00
101阅读
2评论
冒泡排序def bubble_sort(li): for i in range(len(li)-1): # i表示第几趟 for j in range(len(li)-i-1): # j表示图中的箭头 if li[j] > li[j+1]: li[j], li[j+1] = li[j+1], li[j] ===
转载 2023-08-08 13:05:47
82阅读
#include <iostream> #include<algorithm> using namespace std; bool cmp(int a,int b) { return a>b; } int main() { int a[4]={2,9,3,1}; do{ for(int i=0;i<4;i++) cout<<a[i]; ...
原创 2022-03-02 11:20:07
38阅读
#include <iostream>#include<algorithm>using namespace std;bool cmp(int a,int b){ return a>b;}int main(){ int a[4]={2,9,3,1}; do{ for(int i=0;i<4;i++) cout<<a[i];...
原创 2021-06-11 10:04:32
165阅读
经过慎重考虑,也经过反复思考。查阅网上相关资料 1 一位高手对我的建议: 2 一般要做到50行以内的程序不用调试、100行以内的二分钟内调试成功.acm主要是考算法的 3 ,主要时间是花在思考算法上,不是花在写程序与debug上。 4 下面给个计划你练练: 5 6 第一阶段: 7 ...
转载 2015-05-23 09:56:00
74阅读
2评论
Introduce What is Algorithm? 算法是求解问题的*步骤*** 算法的特性 有穷性:一个算法必须在有穷步后结束,每一步必须在有穷时间内完成 算法有穷而程序无穷 确定性:每条指令不能有歧义,即无论运行多少次,相同的输入总能得到相同的输出 可行性:算法中描述的操作都可以通过已经实 ...
转载 2021-03-29 22:18:00
372阅读
2评论
S.No. Name Indexing Search Insertion Optimized Search 1 Linear Array O(1) O(n) N/A O(log n) 2 Dynamic Array O(1) O(n) O(n) O(log n) 3 Linked List O(n) O(n) O(1) O(n) 4 Hash Table O(1) O(1) O(1) ------
原创 2021-09-08 10:13:21
192阅读
I don't know why writing this article. Several days ago, Mrs Yee told us that traslations  would be replaced by writing, hoo,hoo,this is a practice in some way. When I was fac
原创 2010-01-07 17:37:59
611阅读
 我最最亲爱的 Universal 啊,你什么时候才能投入我的怀抱。。。
原创 2010-10-22 21:25:42
408阅读
3评论
Java集合框架的基本接口/类层次结构:java.util.Collection [I] +--java.util.List [I] +--java.util.ArrayList [C] +--java.util.LinkedList [C] +--java.util.Vector [C] //线程安全 ...
转载 2021-09-08 10:13:50
117阅读
Algorithm测试 #include <algorithm> #include <vector> #include <iostream> using namespace std; int main() { vector<int> vec_1 = {3,7,6,2,1,8,9}; auto min
转载 2019-12-11 19:42:00
103阅读
2评论
五、#inlcude < algorithm >下面介绍的几个函数都作用在序列上,接收两个迭代器(或指针)l,r,对下标处于**前闭后开区间【l,r)**中的元素执行一系列操作。sort() 快速排序int n = 3;int a[3] = {3,2,1};//对[0, n)区间进行排序 sort(a, a + n);可以在第三个参数传入定义大小比较的函数,或者重载...
原创 2022-02-03 10:33:52
104阅读
MATLAB 层次路由协议仿真 LEACH算法
原创 2022-08-25 12:58:38
360阅读
// algorithm.cpp : Defines the entry point for the console application.//#include "std
原创 2022-12-23 00:15:50
75阅读
看了知乎的高赞解答,总结一下如何更好地理解和掌握 KMP 算法?判断字符串与模式字符串是否
原创 2022-12-04 07:43:23
70阅读
扩展kmp
原创 2021-09-02 14:50:40
79阅读
https://page.mi.fu-berlin.de/rojas/neural/chapter/K7.pdf 7.1 Learning as gradient descent We saw in the last chapter that multilayered networks are ca
转载 2017-01-10 15:13:00
137阅读
2评论
理论上:一道算法题的不同结果可以用于比较的,都可以用回溯来解决,例如字符串的处理
原创 2022-12-04 07:52:50
117阅读
  E - Sereja and ntly come u...
原创 2023-02-02 11:10:02
91阅读
  • 1
  • 2
  • 3
  • 4
  • 5