René's URL Explorer Experiment


Title: p.g. 490의 '풀이 1 다익스트라 알고리즘 구현' · Issue #3 · onlybooks/java-algorithm-interview · GitHub

Open Graph Title: p.g. 490의 '풀이 1 다익스트라 알고리즘 구현' · Issue #3 · onlybooks/java-algorithm-interview

X Title: p.g. 490의 '풀이 1 다익스트라 알고리즘 구현' · Issue #3 · onlybooks/java-algorithm-interview

Description: 제가 가지고 있는 전자책은 2023년 10월 20일 버전 1.0 입니다. p.g. 490의 '풀이 1 다익스트라 알고리즘 구현'의 풀이에 질문이 있어 문의 드립니다. 본 풀이는 격자 모양을 사방이 거리 1인 노드로 연결된 그래프로 두고, 다익스트라 알고리즘으로 해결하고 있습니다. 하지만 이는 적절하지 않은 풀이입니다. 각 노드 사이의 거리가 1이기 때문에, 다익스트라 알고리즘으로 풀었을 때의 아무런 이점이 없습니다. 동작...

Open Graph Description: 제가 가지고 있는 전자책은 2023년 10월 20일 버전 1.0 입니다. p.g. 490의 '풀이 1 다익스트라 알고리즘 구현'의 풀이에 질문이 있어 문의 드립니다. 본 풀이는 격자 모양을 사방이 거리 1인 노드로 연결된 그래프로 두고, 다익스트라 알고리즘으로 해결하고 있습니다. 하지만 이는 적절하지 않은 풀이입니다. 각 노드 사이의 거리가 1이기 때...

X Description: 제가 가지고 있는 전자책은 2023년 10월 20일 버전 1.0 입니다. p.g. 490의 '풀이 1 다익스트라 알고리즘 구현'의 풀이에 질문이 있어 문의 드립니다. 본 풀이는 격자 모양을 사방이 거리 1인 노드로 연결된 그래프로 두고, 다익스트라 알고리즘으로 해결하고 있습니다. 하지만 이는 적절하지 않은 풀이입니다. 각 노드 사이의 거...

Opengraph URL: https://github.com/onlybooks/java-algorithm-interview/issues/3

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"p.g. 490의 '풀이 1 다익스트라 알고리즘 구현'","articleBody":"제가 가지고 있는 전자책은 2023년 10월 20일 버전 1.0 입니다.\r\n\r\np.g. 490의 '풀이 1 다익스트라 알고리즘 구현'의 풀이에 질문이 있어 문의 드립니다.\r\n\r\n본 풀이는 격자 모양을 사방이 거리 1인 노드로 연결된 그래프로 두고, 다익스트라 알고리즘으로 해결하고 있습니다.\r\n하지만 이는 적절하지 않은 풀이입니다.\r\n\r\n각 노드 사이의 거리가 1이기 때문에, 다익스트라 알고리즘으로 풀었을 때의 아무런 이점이 없습니다.\r\n동작 방식이 아래의 BFS코드와 완전히 동일하며, 유일한 차이는 우선순위큐의 유무이지만 우선순위큐를 사용하는 것이 아래의 이유로 손해입니다.\r\n\r\n- 특정 노드와 연결된 모든 모든 노드와의 거리가 동일하기 때문에 탐색의 우선순위가 없습니다.\r\n- 우선순위 큐를 사용하면 다음 탐색 후보 노드 삽입과 탐색 노드 추출에서 O(log n)으로 오히려 손해를 보게됩니다.\r\n  (BFS 풀이에서는 queue를 사용하므로 이과정이 O(1))\r\n\r\n아래와 같은 BFS 풀이가 더 적절한 풀이라고 생각합니다.\r\n```\r\nimport java.util.*;\r\n\r\nclass Solution {\r\n    int[] dx = {1, 0, -1, 0};\r\n    int[] dy = {0, 1, 0, -1};\r\n\r\n    public int solution(int[][] maps) {\r\n        return bfs(maps);\r\n    }\r\n\r\n    public int bfs(int[][] maps) {\r\n        Queue\u003cint[]\u003e queue = new LinkedList\u003c\u003e();\r\n        queue.add(new int[]{0, 0, 1});\r\n        maps[0][0] = 0;\r\n\r\n        while (!queue.isEmpty()) {\r\n            int[] current = queue.poll();\r\n            int curX = current[0];\r\n            int curY = current[1];\r\n            int depth = current[2];\r\n            if (curX == maps.length - 1 \u0026\u0026 curY == maps[0].length - 1) {\r\n                return depth;\r\n            }\r\n\r\n            for (int i = 0; i \u003c 4; i++) {\r\n                int nextX = curX + dx[i];\r\n                int nextY = curY + dy[i];\r\n\r\n                if (nextX \u003e= 0 \u0026\u0026 nextX \u003c maps.length \u0026\u0026 nextY \u003e= 0 \u0026\u0026 nextY \u003c maps[0].length \u0026\u0026 maps[nextX][nextY] == 1) {\r\n                    maps[nextX][nextY] = 0;\r\n                    queue.add(new int[]{nextX, nextY, depth + 1});\r\n                }\r\n            }\r\n        }\r\n        return -1;\r\n    }\r\n}\r\n```\r\n실제 프로그래머스의 효율성 테스트 결과 역시 차이가 있음을 확인하였습니다.\r\n\r\n1. 책에 기재된 다익스트라 풀이 코드\r\n![image](https://github.com/onlybooks/java-algorithm-interview/assets/67893559/cb81ba22-0f3a-4e64-a5ec-ba3a4a269f6c)\r\n\r\n2. BFS 풀이\r\n![image](https://github.com/onlybooks/java-algorithm-interview/assets/67893559/6f75b799-2eb7-4759-9093-196e744ba40a)\r\n\r\n검토 부탁드리며, 혹시 저의 의견중 틀린 부분이 있으면 알려주시면 감사하겠습니다.","author":{"url":"https://github.com/hoogom88","@type":"Person","name":"hoogom88"},"datePublished":"2024-02-14T04:48:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3/java-algorithm-interview/issues/3"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:84df0e68-26cb-74ed-85cb-9c675bbcf974
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA45A:F9BE6:5251422:709125C:697825B5
html-safe-nonce70ebb5697dbc4d996bf88e4d8b7f7b90776b9beb0305c62da57c52b52e810609
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDVBOkY5QkU2OjUyNTE0MjI6NzA5MTI1Qzo2OTc4MjVCNSIsInZpc2l0b3JfaWQiOiI1MTAzNTczNDQ2MTkzMzI1NDkzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac1e7fed0ba2921dcc6ea92985cb82c5d7c4da21b3eb45ed44b9bc3740c71479f4
hovercard-subject-tagissue:2133533245
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/onlybooks/java-algorithm-interview/3/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a1ae36616ee1862be49313e96f689b48925f869c2974f818036b846bc5e92ae6/onlybooks/java-algorithm-interview/issues/3
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a1ae36616ee1862be49313e96f689b48925f869c2974f818036b846bc5e92ae6/onlybooks/java-algorithm-interview/issues/3
og:image:alt제가 가지고 있는 전자책은 2023년 10월 20일 버전 1.0 입니다. p.g. 490의 '풀이 1 다익스트라 알고리즘 구현'의 풀이에 질문이 있어 문의 드립니다. 본 풀이는 격자 모양을 사방이 거리 1인 노드로 연결된 그래프로 두고, 다익스트라 알고리즘으로 해결하고 있습니다. 하지만 이는 적절하지 않은 풀이입니다. 각 노드 사이의 거리가 1이기 때...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamehoogom88
hostnamegithub.com
expected-hostnamegithub.com
None2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50
turbo-cache-controlno-preview
go-importgithub.com/onlybooks/java-algorithm-interview git https://github.com/onlybooks/java-algorithm-interview.git
octolytics-dimension-user_id36435243
octolytics-dimension-user_loginonlybooks
octolytics-dimension-repository_id684433808
octolytics-dimension-repository_nwoonlybooks/java-algorithm-interview
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id684433808
octolytics-dimension-repository_network_root_nwoonlybooks/java-algorithm-interview
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8cc3e064910e26648760f573a358cfc07c97b42c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/issues/3#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fonlybooks%2Fjava-algorithm-interview%2Fissues%2F3
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fonlybooks%2Fjava-algorithm-interview%2Fissues%2F3
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=onlybooks%2Fjava-algorithm-interview
Reloadhttps://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/issues/3
Reloadhttps://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/issues/3
Reloadhttps://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/issues/3
onlybooks https://patch-diff.githubusercontent.com/onlybooks
java-algorithm-interviewhttps://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fonlybooks%2Fjava-algorithm-interview
Fork 26 https://patch-diff.githubusercontent.com/login?return_to=%2Fonlybooks%2Fjava-algorithm-interview
Star 110 https://patch-diff.githubusercontent.com/login?return_to=%2Fonlybooks%2Fjava-algorithm-interview
Code https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview
Issues 4 https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/issues
Pull requests 0 https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/pulls
Actions https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/actions
Projects 0 https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/projects
Security 0 https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/security
Insights https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/pulse
Code https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview
Issues https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/issues
Pull requests https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/pulls
Actions https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/actions
Projects https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/projects
Security https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/security
Insights https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/onlybooks/java-algorithm-interview/issues/3
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/onlybooks/java-algorithm-interview/issues/3
p.g. 490의 '풀이 1 다익스트라 알고리즘 구현'https://patch-diff.githubusercontent.com/onlybooks/java-algorithm-interview/issues/3#top
https://github.com/hoogom88
https://github.com/hoogom88
hoogom88https://github.com/hoogom88
on Feb 14, 2024https://github.com/onlybooks/java-algorithm-interview/issues/3#issue-2133533245
https://private-user-images.githubusercontent.com/67893559/304623014-cb81ba22-0f3a-4e64-a5ec-ba3a4a269f6c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njk0ODE5NTQsIm5iZiI6MTc2OTQ4MTY1NCwicGF0aCI6Ii82Nzg5MzU1OS8zMDQ2MjMwMTQtY2I4MWJhMjItMGYzYS00ZTY0LWE1ZWMtYmEzYTRhMjY5ZjZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAxMjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMTI3VDAyNDA1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJhMGFjODdjZTdlZWFhYzhhMDIzZGY0NzI3ZTI2OTFmNDE4ZDZhNGRlY2M0NzNjZGM0MTU3YzZjYjc5YWE2OTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.C5HeroYOkcdiLYrEJmCg7i-VRT-VDJpao_5HH6mwC7w
https://private-user-images.githubusercontent.com/67893559/304623028-6f75b799-2eb7-4759-9093-196e744ba40a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njk0ODE5NTQsIm5iZiI6MTc2OTQ4MTY1NCwicGF0aCI6Ii82Nzg5MzU1OS8zMDQ2MjMwMjgtNmY3NWI3OTktMmViNy00NzU5LTkwOTMtMTk2ZTc0NGJhNDBhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAxMjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMTI3VDAyNDA1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkxM2Y2NzI0NmQxMmQzOTkwY2U1OWJlZjY3YTY5MzBmZDQ1ZTA2YTkzMTFkMTMxNmYxMDVkOTE0YTBkMDlkMGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.goKkhtD97Duq6AVYpuQDQzP8hY3fikXsCL66bvYpznM
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.