Segment Tree
What is Segment Tree? Segment Tree is a type of binary tree, which is used to solve the question in a range, such as finding the max one or min one in range L to R. The segment tree will divide th...
What is Segment Tree? Segment Tree is a type of binary tree, which is used to solve the question in a range, such as finding the max one or min one in range L to R. The segment tree will divide th...
What is Binary Indexed Tree The Binary Indexed Tree is used to solve the question of range sum query and point update. Giving a series of numbers, we suppose that we need the sum of index L to R, ...
在这个博客中,我们将要着重学习后端设计,并了解数据库的基本使用。 注:为简化学习,将前端框架置于此,不再单独讲解。(后续讲解前端调用后端API流程时会提到) 该项目提供三个页面(可跳转) index.html <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UT...
简单网页设计 后端设计 一、所需工具 1.工具和框架 由于该项目仅供学习使用,不接入真实服务器,故使用Node.js来部署一个本地HTTP服务器,并用Express框架来处理前端请求,托管静态网页,图片和脚本程序。 const express = require('express'); // 导入Express框架 const path = require('path');// 安...
What is A-star? A-star is the algorithm solving the single source shortest path question, which combined the Dijkstra and Heuristic Search. That means the A* is Dijkstra with eyes! How does it wo...
How does it work? From the Floyd algorithm, we use $dist[i][j] = dist[i][k] + dist[k][j]$. In matrix, supposing the matrix A, we discuss the $A[i][j]$ and $A^2[i][j]$. According to the rule of mat...
What is Borůvka? Borůvka is the oldest algorithm solving MST, which is based on the greedy algorithm. How does it work? Borůvka considers each node as a component initially, and expand the compo...
What is Johnson Johnson is used to solve the all-pairs shortest path with the strenths of Dijkstra and Bellman Ford. How does it work For Dijkstra, it is fast but can not solve the graph with ne...
What is SPFA The SPFA (Shortest Path Faster Algorithm) is an optimization of the Bellman-Ford algorithm. How does it works When we use Bellman Ford, we find that all the edges will be relaxed at...
What is Floyd? Floyd is an all-pairs shortest path algorithm. The difference between it and the single source shortest path algorithm is that it can find the shortest distance between all pairs of...