mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
all: fix typos (#19634)
This commit is contained in:
parent
407adaa3c1
commit
9051ac8921
108 changed files with 235 additions and 214 deletions
|
@ -11,7 +11,7 @@ http://rascunhointeligente.blogspot.com/2010/10/o-algoritmo-de-bellman-ford-um.h
|
|||
code by CCS
|
||||
*/
|
||||
|
||||
const large = 999999 // almost inifinity
|
||||
const large = 999999 // almost infinity
|
||||
|
||||
// a structure to represent a weighted edge in graph
|
||||
struct EDGE {
|
||||
|
|
|
@ -125,7 +125,7 @@ fn dijkstra(g [][]int, s int) {
|
|||
push_pq(mut pq_queue, s, 0) // goes s with priority 0
|
||||
mut n := g.len
|
||||
|
||||
mut dist := []int{len: n, init: -1} // dist with -1 instead of INIFINITY
|
||||
mut dist := []int{len: n, init: -1} // dist with -1 instead of INFINITE
|
||||
mut path := []int{len: n, init: -1} // previous node of each shortest path
|
||||
|
||||
// Distance of source vertex from itself is always 0
|
||||
|
@ -133,7 +133,7 @@ fn dijkstra(g [][]int, s int) {
|
|||
|
||||
for pq_queue.len != 0 {
|
||||
mut v := departure_priority(mut pq_queue)
|
||||
// for all W adjcents vertices of v
|
||||
// for all W adjacents vertices of v
|
||||
mut adjs_of_v := all_adjacents(g, v) // all_ADJ of v ....
|
||||
// print('\n ADJ ${v} is ${adjs_of_v}')
|
||||
mut new_dist := 0
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Exploring PRIMS,
|
||||
Exploring PRIMS,
|
||||
The data example is from
|
||||
https://www.geeksforgeeks.org/prims-minimum-spanning-tree-mst-greedy-algo-5/
|
||||
|
||||
|
@ -117,7 +117,7 @@ fn prim_mst(g [][]int, s int) {
|
|||
push_pq(mut pq_queue, s, 0) // goes s with priority 0
|
||||
mut n := g.len
|
||||
|
||||
mut dist := []int{len: n, init: -1} // dist with -1 instead of INIFINITY
|
||||
mut dist := []int{len: n, init: -1} // dist with -1 instead of INFINITE
|
||||
mut path := []int{len: n, init: -1} // previous node of each shortest path
|
||||
|
||||
// Distance of source vertex from itself is always 0
|
||||
|
@ -125,7 +125,7 @@ fn prim_mst(g [][]int, s int) {
|
|||
|
||||
for pq_queue.len != 0 {
|
||||
mut v := departure_priority(mut pq_queue)
|
||||
// for all W adjcents vertices of v
|
||||
// for all W adjacents vertices of v
|
||||
mut adjs_of_v := all_adjacents(g, v) // all_ADJ of v ....
|
||||
// print('\n :${dist} :: ${pq_queue}')
|
||||
// print('\n ADJ ${v} is ${adjs_of_v}')
|
||||
|
@ -209,7 +209,7 @@ fn main() {
|
|||
[5, 15, 4, 0],
|
||||
]
|
||||
|
||||
// To find number of coluns
|
||||
// To find number of columns
|
||||
// mut cols := an_array[0].len
|
||||
mut graph := [][]int{} // the graph: adjacency matrix
|
||||
// for index, g_value in [graph_01, graph_02, graph_03] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue