{"id":18387205,"url":"https://github.com/kimhan-nah/hello-algorithm-sql","last_synced_at":"2025-04-12T02:14:25.396Z","repository":{"id":178857045,"uuid":"661539684","full_name":"Kimhan-nah/hello-algorithm-sql","owner":"Kimhan-nah","description":"알알못 기만나가 알잘알이 쿼리 마스터가 되는 그날까지..!!!!!","archived":false,"fork":false,"pushed_at":"2024-11-06T01:01:29.000Z","size":436,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T02:14:22.031Z","etag":null,"topics":["algorithms","java","sql"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kimhan-nah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-03T05:29:29.000Z","updated_at":"2024-11-06T01:01:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f86ac67-9bfe-439e-9f42-9ff7750d16fe","html_url":"https://github.com/Kimhan-nah/hello-algorithm-sql","commit_stats":null,"previous_names":["kimhan-nah/hello-algorithm","kimhan-nah/hello-algorithm-sql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kimhan-nah%2Fhello-algorithm-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kimhan-nah%2Fhello-algorithm-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kimhan-nah%2Fhello-algorithm-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kimhan-nah%2Fhello-algorithm-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kimhan-nah","download_url":"https://codeload.github.com/Kimhan-nah/hello-algorithm-sql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505925,"owners_count":21115354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","java","sql"],"created_at":"2024-11-06T01:25:19.568Z","updated_at":"2025-04-12T02:14:25.373Z","avatar_url":"https://github.com/Kimhan-nah.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hello-algorithm-sql\n\u003e 알고리즘 문제와 SQL 문제 풀이를 기록하는 레포지토리입니다.\n\n\u003e 알알못 기만나가 알잘알 + SQL 마스터가 되는 그날까지..!!!!!\n\n[![Solved.ac\n프로필](http://mazassumnida.wtf/api/v2/generate_badge?boj=skqkdldhf98)](https://solved.ac/skqkdldhf98)\n\n# MST (Minimum Spanning Tree)\n\u003e 최소 신장 트리, Spanning Tree 중 사용된 가선들의 가중치 합이 최소인 트리\n### 1. Kruskal MST Algorithm\n - greedy method 이용\n - 각 단계에서 사이클을 이루지 않는 최소 비용 간선 선택\n - 간선 선택 기반으로 하는 알고리즘\n - 이전 단계에서 만들어진 신장 트리와는 상관 없이 무조건 최소 간선만을 선택하는 방법\n\n### 2. Prim MST Algorithm\n - 시작 정점에서부터 출발하여 신장트리 집합을 단계적으로 확장해 나가는 방법\n - 정점 선택 기반으로 하는 알고리즘\n - 이전 단계에서 만들어진 신장 트리를 확장하는 방법\n\n# HashMap 활용\n## 출력 방법\n### 방법 1. entrySet()\n\n```java\nimport java.util.HashMap;\n\nclass Main {\n  public static void main(String[] args) {\n    Map\u003cInteger, Intger\u003e map = new HashMap\u003c\u003e();\n    Set\u003cMap.Entry\u003cInteger, Integer\u003e\u003e entries = map.entrySet();\n    for (Map.Entry\u003cInteger, Integer\u003e entry : entries) {\n      System.out.println(entry.getKey() + \" \" + entry.getValue());\n    }\n  }\n}\n```\n\n### 방법 2. keySet()\n```java\nclass Main {\n  public static void main(String[] args) {\n    Map\u003cInteger, Intger\u003e map = new HashMap\u003c\u003e();\n    Set\u003cInteger\u003e integers = map.keySet();\n    for (Integer key : map.keySet()) {\n      System.out.println(key + \" \" + map.get(key));\n    }\n  }\n}\n```\n\n### 방법 3. Lambda\n```java\nclass Main {\n  public static void main(String[] args) {\n    Map\u003cInteger, Intger\u003e map = new HashMap\u003c\u003e();\n    map.forEach((key, val) -\u003e {\n      System.out.println(key + \" \" + val);\n    });\n  }\n}\n```\n\n### 방법 4. Stream 사용\n- 내림차순\n    ```java\n    class Main {\n      public static void main(String[] args) {\n        Map\u003cInteger, Intger\u003e map = new HashMap\u003c\u003e();\n        map.entrySet().stream().forEach(entry -\u003e {\n          System.out.println(entry.getKey() + \" \" + entry.getValue());\n        });\n      }\n    }\n    ```\n\n- 오름차순\n    ```java\n    class Main {\n      public static void main(String[] args) {\n        Map\u003cInteger, Intger\u003e map = new HashMap\u003c\u003e();\n        map.entrySet().stream().sorted(Map.Entry.comparingByKey(Comparator.reverseOrder())).forEach(entry -\u003e {\n          System.out.println(entry.getKey() + \" \" + entry.getValue());\n        });\n      }\n    }\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimhan-nah%2Fhello-algorithm-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimhan-nah%2Fhello-algorithm-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimhan-nah%2Fhello-algorithm-sql/lists"}