迪克斯特拉算法
Dijkstra算法使用了广度优先搜索解决赋权有向图或无向图的单源最短路径问题输入:有权重的图G,起点S,V是途中顶点集合,E是图中所有顶点的集合。边为(u,v),权重为w(u,v)输出:起点到任何其他顶点的最低权重路径流程:这个算法是通过为每个顶点v保留当前为止所找到的从s到v的最短路径来工作的。初始时,起点s的路径权重...
2019-08-29
Go 切片绕坑指南
不知道大家有没有发现在一个函数内部对切片参数进行了排序后也会改变函数外部原来的切片中元素的顺序,但是在函数内向切片增加了元素后在函数外的原切片却没有新增元素,更奇怪的是添加并排序后,外部的切片有可能元素数量和元素顺序都不会变,这是为什么呢?我们通过三个小测验来解释造成这个现象的原因。
js数组去重(包含ES6解决方案)
Take 2 strings s1 and s2 including only letters from ato z. Return a new sorted string, the longest possible, containing distinct letters, - each taken only once - coming from s1 or s2.
C++加解密函数范例
{代码...}
2014-06-12
C++-Unicode字符utf8编码与码点code point值互转编码示例
{代码...}
2024-08-06
最短路模板(dijkstra+spfa)~(链式向前星+邻接表)
有一段时间没做最短路的题了,写题实在手生,于是我决定写下此篇模板,从原理出发,把原理刻在脑子里。马上要比赛了,我也告诫自己思路决定出路,思维第一,绝不背诵代码当然火热的手感也是提速的关键,不背但是要熟练,那就每天起床第一步,先敲一遍最短路最后面也放上我近期刷题的总结。
2022-08-26
代码注释,我们不一样
{代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码...} {代码.....
css animation transform
1.animation 阮一峰讲案 {代码...} 2.css3波浪动画特效 {代码...} 3.jQuery粒子背景插件circleMagic.js {代码...} 4.注解 {代码...} 5.动画案例集案例持续补充中...6.呼吸效果 {代码...} 7.旋转动画 {代码...}
2020-05-12
[Golang]力扣Leetcode—剑指Offer—字符串—58 - II. 左旋转字符串
题目:字符串的左旋转操作是把字符串前面的若干个字符转移到字符串的尾部。请定义一个函数实现字符串左旋转操作的功能。比如,输入字符串"abcdefg"和数字2,该函数将返回左旋转两位得到的结果"cdefgab"。
2022-03-21
xss攻击概念及防御
一.xss攻击方式反射型、存储型1.反射型发出请求时,xss代码存在于URL中,作为输入提交到服务器端,服务器端解析后响应,xss代码随响应内容一起传回给浏览器,最后浏览器解析执行xss代码。2.存储型存储型xss代码和反射弧xss代码区别仅在于,提交的代码回存储在服务器端(数据库,内存,文件系统等),下次请求目标页面时...
es6(二):字符串的扩展
{代码...}
2016-12-09
Go package(2) strings 用法
go version go1.10.3Go中的字符串用法,可以在 godoc.org 上查看语法和用法。最简单的语法就是获取字符串中的子串 {代码...} 一:查找1、查找返回索引godoc.org上索引的方法Index {代码...} Index returns the index of the first instance of substr in s, or -1 if substr is not present in s.说明:返回子串substr在...
如何在 Kubernetes 中使用 ClickHouse 和 JuiceFS
ClickHouse 结合 JuiceFS 一直是一个热门的组合,社区中有多篇实践案例。今天的文章来自美国公司 Altinity,一家提供 ClickHouse 商业服务的企业,作者是 Vitaliy Zakaznikov,他尝试了这个组合并公开了过程中使用的代码。原文有两篇文章,“Squeezing JuiceFS with ClickHouse (Part 1): Setting Things Up in Kubernete...
2024-08-02
Leetcode 44 Wildcard Matching 通配符匹配
Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matches any sequence ofcharacters (including the empty sequence). The matching should cover the entire input string (not partial). The function prototype should be: bool isMatch(const char *s,c...
2017-01-18
CSCI 3110
CSCI 3110Imagine I’m standing in front of you holding up two little pieces of silver-grey metal and betweenus is a bucket of water. You can see the pieces of metal look pretty much the same; I tap themon the desk so you can tell they sound about the same; I pass them around so you can check theyf...
2021-07-03
Redis源码入门-字符串sds,sdshdr
看到这你肯定内心觉得Redis在逗你,这不就是一个字符数组么,怎么就Simple Dynamic Strings了呢 !没错,我当时也是这么觉得的,但是仔细阅读源码后发现sds并不是一个人在战斗,它还有战友sdshdr,sdshdr是个五胞胎,分别是sdshdr5,sdshdr8,sdshd16,sdshdr32,sdshd64。块头从小到大。
2021-02-24
Introduction to JavaScript Object Notation Note For Chapter 1
What is JSON JSON is a Data Interchange Format It's used to exchange data between different platforms or systems. Another data interchange format is XML(Extensible Markup Language) Or CSV(Comma-separated values) JSON is Programming Language Independent If you know JS is good to learn JSON but not...
2015-11-30