mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-04 22:28:40 +08:00
docs: add Japanese translate documents (#1812)
* docs: add Japanese documents (`ja/docs`) * docs: add Japanese documents (`ja/codes`) * docs: add Japanese documents * Remove pythontutor blocks in ja/ * Add an empty at the end of each markdown file. * Add the missing figures (use the English version temporarily). * Add index.md for Japanese version. * Add index.html for Japanese version. * Add missing index.assets * Fix backtracking_algorithm.md for Japanese version. * Add avatar_eltociear.jpg. Fix image links on the Japanese landing page. * Add the Japanese banner. --------- Co-authored-by: krahets <krahets@163.com>
This commit is contained in:
committed by
GitHub
parent
2487a27036
commit
954c45864b
36
ja/codes/cpp/utils/vertex.hpp
Normal file
36
ja/codes/cpp/utils/vertex.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
* File: vertex.hpp
|
||||
* Created Time: 2023-03-02
|
||||
* Author: krahets (krahets@163.com)
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
/* 頂点クラス */
|
||||
struct Vertex {
|
||||
int val;
|
||||
Vertex(int x) : val(x) {
|
||||
}
|
||||
};
|
||||
|
||||
/* 値のリストvals を入力し、頂点のリストvets を返す */
|
||||
vector<Vertex *> valsToVets(vector<int> vals) {
|
||||
vector<Vertex *> vets;
|
||||
for (int val : vals) {
|
||||
vets.push_back(new Vertex(val));
|
||||
}
|
||||
return vets;
|
||||
}
|
||||
|
||||
/* 頂点のリストvets を入力し、値のリストvals を返す */
|
||||
vector<int> vetsToVals(vector<Vertex *> vets) {
|
||||
vector<int> vals;
|
||||
for (Vertex *vet : vets) {
|
||||
vals.push_back(vet->val);
|
||||
}
|
||||
return vals;
|
||||
}
|
||||
Reference in New Issue
Block a user