码迷,mamicode.com
首页 >  
搜索关键字:插入排序 算法    ( 84514个结果
算法图解——截留雨水( Trapping Rain Water)
1. 题目描述 Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining ...
分类:移动开发   时间:2021-02-18 13:31:34    阅读次数:0
快速排序
快速排序是用的比较多的排序算法,比如需要对“6 1 2 7 9 3 4 5 10 8”这几个数进行排序。方法是首先在这个序列中随便找一个数作为基准数。比如找 6 作为基准数, 然后需要将这个序列中所有比基准数 6 大的数放右边,比基准数小的数放 6 的左边,类似如下排列: 初始的状态下数字 6 在序 ...
分类:编程语言   时间:2021-02-18 13:11:13    阅读次数:0
图解算法——矩阵转换(Rotate Image)
1. 题目描述 You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, whi ...
分类:编程语言   时间:2021-02-18 13:08:31    阅读次数:0
图解算法——全排列(Permutations)
1. 题目描述 Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. 2. Examples 示例1: Input ...
分类:编程语言   时间:2021-02-18 13:07:50    阅读次数:0
算法基础练习-_03 1的个数
请实现一一个函数,输入一个整数,输出该数二进制表示中1的个数。 例: 9的二进制表示为1001,有2位是1 import java.util.Scanner; public class _03_1的个数 { public static void main(String[] args) { Scann ...
分类:编程语言   时间:2021-02-18 13:03:18    阅读次数:0
字符串进阶算法小结
前言: 本文参考《信息学奥赛一本通·金牌导航》。 正文: Manacher 算法: 概念: Manacher 算法,经常被称作马拉车,可以以 \(\mathcal{O}(n)\) 的时间复杂度求出字符串关于回文子串一类的问题。 介绍: 首先举个例子,设字符串 \(s=\texttt{bbdkd}\) ...
分类:编程语言   时间:2021-02-17 15:06:24    阅读次数:0
最小生成树 : 拆点
https://www.acwing.com/problem/content/1145/ 思路 \(把已有的边加上,会形成各个连通块,等价于把每个连通块当成一个点去做Kruskal算法.\) #include <bits/stdc++.h> using namespace std; #define ...
分类:其他好文   时间:2021-02-17 14:56:41    阅读次数:0
分治算法
一.总述 分治算法其实就是将一个大问题分解为若干个类型相同但是规模较小的子问题,使用递归的方式一直分解下去,然后将子问题的解合并得到原问题的解的策略。 二.经典的分治算法列举 二分搜索、大整数乘法、strassen矩阵乘法、棋盘覆盖、合并排序、快速排序、线性时间选择、最接近点对问题、循环赛日程表、汉 ...
分类:编程语言   时间:2021-02-17 14:56:19    阅读次数:0
二叉树的最近公共祖先--递归解法
来源: https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/solution/er-cha-shu-de-zui-jin-gong-gong-zu-xian-by-leetc-2/ 信息分类: IT/算法 ...
分类:其他好文   时间:2021-02-17 14:40:10    阅读次数:0
Effective C++这书很好
【1】视C++为一个语言联邦 C++包含4个次语言:C,面向对象C++,模板,STL。 C:C++是以C语言为基础一门语言,其基本的blocks,statements,preprocessor等都是一样的 面向对象C++:封装,继承,多态 模板:泛型编程基础 STL:对容器,迭代器,算法紧密的配合与 ...
分类:编程语言   时间:2021-02-17 14:37:20    阅读次数:0
84514条   上一页 1 ... 60 61 62 63 64 ... 8452 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!