![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
Gallant Hu
计算机视觉 机器学习 深度学习
展开
-
C++ vector的实现原理
c++ 数组删除制定元素原创 2022-09-17 18:33:03 · 452 阅读 · 0 评论 -
求子数组和的最大值及其时间复杂度分析
典型的输入能帮助我们测试算法的逻辑。在写具体算法前列出各种可能输入,可以帮助明确题目的要求。最直接的方法:记 Sum[i, …, j] 为 数组A中第i个元素到第j个元素的和(其中 0≤i≤j<n0\leq i\leq j< n0≤i≤j<n),遍历所有可能的Sum[i, …, j] ,那么时间复杂度为O(N3)O(N^3)O(N3):int MaxSum(int* A, int n){ int maximum=-INF; int sum; for(int i=0;i<原创 2020-11-18 09:43:12 · 1118 阅读 · 0 评论 -
链表和数组存取的区别
效率,内存移动顺序存储…原创 2020-11-09 11:16:37 · 101 阅读 · 0 评论 -
两单链表相交判断与交点查找
思路提示两单链表相交后的形状:Y;怎样倒着往前找:栈,用两个栈。原创 2020-11-09 11:12:45 · 134 阅读 · 0 评论 -
堆排序从原理到实现(C++描述)
大顶堆与小顶堆A Binary Heap is a Complete Binary Tree where items are stored in a special order such that value in a parent node is greater(or smaller) than the values in its two children nodes. The former is called as max heap and the latter is called min-heap.原创 2020-09-10 21:49:30 · 197 阅读 · 0 评论 -
链表的实现(原始方法)
单向链表的实现双向链表的实现原创 2020-08-26 21:47:00 · 141 阅读 · 0 评论 -
使用单调栈模型进行程序设计
单调递增栈单调递减栈原创 2020-08-26 21:07:29 · 74 阅读 · 0 评论 -
堆排序从理解到应用
Heap堆的定义如下:具有n个元素的序列(h1,h2,...,hn)(h_1, h_2, ..., h_n)(h1,h2,...,hn),当且仅当满足{hi≥h2ihi≥h2i+1\left\{ \begin{array}{lr} h_i \geq h_{2i} \\ h_i\geq h_{2i+1} &...原创 2019-12-25 17:40:37 · 364 阅读 · 0 评论 -
动态规划求解最短编辑距离
最短编辑距离The edit distance between two strings is the minimum number of letter insertions(插入), letterdeletions(删除), and letter substitutions(替换) required to transform one string into another. For examp...原创 2019-12-17 10:08:08 · 319 阅读 · 0 评论 -
采用动态规划算法解决最长上升子序列(LIS)问题
最长上升子序列问题求解上升子序列指的是对于任意的i<j都满足ai<aj的子序列。#include<bits/stdc++.h>using namespace std;int DP[1010][1010];int n,m;int main(){ DP[0][0]=1; cin>>n>>m; for(int i=1;i<=n;i...原创 2019-11-20 12:54:45 · 603 阅读 · 0 评论