알고리즘
-
Astar알고리즘을 이용한 몬스터 이동알고리즘/문제해결 2022. 9. 15. 16:46
http://www.gisdeveloper.co.kr/?p=3897 최단 경로 탐색 – A* 알고리즘 – GIS Developer 최단 경로 탐색 알고리즘 중 A*(A Star, 에이 스타) 알고리즘에 대해 실제 예시를 통해 풀어가면서 설명하겠습니다. A* 알고리즘은 시작 노드만을 지정해 다른 모든 노드에 대한 최단 경로를 파악하 www.gisdeveloper.co.kr using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class MapData { public Vector2Int bottomLeft, topRight; public int sizeX, siz..
-
Stack 순서도알고리즘/수업내용 2022. 7. 4. 12:33
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study13 { public class Stack : IEnumerable { private Node top; public Stack() { } public void Push(T data) { if (this.top == null) { top = new Node(data); } else { var node = new Node(data); node.next = top; top = node; } } public T Pop() { if (t..
-
Queue 순서도알고리즘/수업내용 2022. 7. 4. 11:50
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study13 { public class Node { public T data; public Node next; public Node(T data) { this.data = data; this.next = null; } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study13 { public cl..
-
링크드 리스트알고리즘/수업내용 2022. 7. 1. 17:18
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study12 { internal class Program { static void Main(string[] args) { var linkedlist = new LinkedList(); var node = new Node("홍길동"); linkedlist.Add(node); Node node1 = new Node("임꺽정"); linkedlist.Add(node1); Node node2 = new Node("장길산"); linkedlist.Add(node2); Node node3 =..