mirror of
				https://github.com/krahets/hello-algo.git
				synced 2025-11-01 03:24:24 +08:00 
			
		
		
		
	 a005c6ebd3
			
		
	
	a005c6ebd3
	
	
	
		
			
			* Update avatar's link in the landing page * Bug fixes * Move assets folder from overrides to docs * Reduce figures' corner radius * Update copyright * Update header image * Krahets -> krahets * Update the landing page
		
			
				
	
	
		
			21 lines
		
	
	
		
			479 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			479 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| # File: vertex.py
 | |
| # Created Time: 2023-02-23
 | |
| # Author: krahets (krahets@163.com)
 | |
| 
 | |
| 
 | |
| class Vertex:
 | |
|     """顶点类"""
 | |
| 
 | |
|     def __init__(self, val: int):
 | |
|         self.val = val
 | |
| 
 | |
| 
 | |
| def vals_to_vets(vals: list[int]) -> list["Vertex"]:
 | |
|     """输入值列表 vals ,返回顶点列表 vets"""
 | |
|     return [Vertex(val) for val in vals]
 | |
| 
 | |
| 
 | |
| def vets_to_vals(vets: list["Vertex"]) -> list[int]:
 | |
|     """输入顶点列表 vets ,返回值列表 vals"""
 | |
|     return [vet.val for vet in vets]
 |