René's URL Explorer Experiment


Title: 【问题Q&A】收集 · Issue #49 · algorithm008-class02/algorithm008-class02 · GitHub

Open Graph Title: 【问题Q&A】收集 · Issue #49 · algorithm008-class02/algorithm008-class02

X Title: 【问题Q&A】收集 · Issue #49 · algorithm008-class02/algorithm008-class02

Description: Q: 这里的时间复杂度是 n 还是 n^2 func moveZeroes(nums []int) { j:=0 for i:=0; i

Open Graph Description: Q: 这里的时间复杂度是 n 还是 n^2 func moveZeroes(nums []int) { j:=0 for i:=0; i

X Description: Q: 这里的时间复杂度是 n 还是 n^2 func moveZeroes(nums []int) { j:=0 for i:=0; i<len(nums); i++{ if nums[j] == 0 { // nums = append(nums[:j], append(nums[j+1:], nums[j])...) nums = append(nums[:j], nums[j+1...

Opengraph URL: https://github.com/algorithm008-class02/algorithm008-class02/issues/49

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"【问题Q\u0026A】收集","articleBody":"\u003e Q: 这里的时间复杂度是 n 还是 n^2\r\n\r\n```go\r\nfunc moveZeroes(nums []int)  {\r\n    j:=0\r\n    for i:=0; i\u003clen(nums); i++{\r\n        if nums[j] == 0 {\r\n            // nums = append(nums[:j], append(nums[j+1:], nums[j])...)\r\n            nums = append(nums[:j], nums[j+1:]...)\r\n\t\t\tnums = append(nums, 0)\r\n            j--\r\n        }\r\n        j++\r\n    }\r\n}\r\n```\r\n\r\nA: 这里值得注意的是 ` nums = append(nums[:j], nums[j+1:]...)` 这条语句, 它的作用不是 添加而是删除 下标为 j 的元素,**在数组中,插入和删除元素的时间复杂度是 O(n)**, 由于外层 for 循环 的关系,这里的整体时间复杂度是 O(n^2)\r\n\r\n\r\n\r\n\r\n\u003e Q: 检测环的时候使用快慢指针,走2步和走多步哪个效率高,怎么证明?\r\n\r\nhttps://code-examples.net/zh-CN/q/4e4806\r\n\r\n\r\n\r\n\u003e Q: 网上说链表和数组的插入性能都是o(n) ,这块是什么情况?\r\n\r\nA: 数组的插入 O(n) 的复杂度毫无疑问,但是链表的插入为 O(n) 是有问题的,在这里,**链表在某个点插入新的结点的时间复杂度是 O(1), 但是在找到这个位置的过程时间复杂度是 O(n)**, 注意把握概念。\r\n","author":{"url":"https://github.com/GeekUniversity","@type":"Person","name":"GeekUniversity"},"datePublished":"2020-05-09T08:12:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/49/algorithm008-class02/issues/49"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1b1a48c4-5200-5ada-89da-7eff62522d00
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCA3A:1D772C:821788:B0B411:696AB552
html-safe-nonce9d36e534b20e20e8848f8859a984126431c89e7b46df00beceee1404bf7f543c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTNBOjFENzcyQzo4MjE3ODg6QjBCNDExOjY5NkFCNTUyIiwidmlzaXRvcl9pZCI6IjM0NDI4ODQ4NTc1NTk2OTI2MjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc7ce7cb53b48625a6ba51bc4f906a4b0c9bbc0c90a688281aa812ee39751d75f
hovercard-subject-tagissue:615121049
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/algorithm008-class02/algorithm008-class02/49/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2b8d0c51c282f334644db1e201fdcf3fce815303952a212884055960f3d0cd93/algorithm008-class02/algorithm008-class02/issues/49
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2b8d0c51c282f334644db1e201fdcf3fce815303952a212884055960f3d0cd93/algorithm008-class02/algorithm008-class02/issues/49
og:image:altQ: 这里的时间复杂度是 n 还是 n^2 func moveZeroes(nums []int) { j:=0 for i:=0; i
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameGeekUniversity
hostnamegithub.com
expected-hostnamegithub.com
None4fa1799b6a53c2d30c950d74230781bef9e7f61138c72c7727e4b83f0743752b
turbo-cache-controlno-preview
go-importgithub.com/algorithm008-class02/algorithm008-class02 git https://github.com/algorithm008-class02/algorithm008-class02.git
octolytics-dimension-user_id63438274
octolytics-dimension-user_loginalgorithm008-class02
octolytics-dimension-repository_id254539376
octolytics-dimension-repository_nwoalgorithm008-class02/algorithm008-class02
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id254539376
octolytics-dimension-repository_network_root_nwoalgorithm008-class02/algorithm008-class02
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
release41f276818bd204c4a30a0281fb3c576298d9474c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/algorithm008-class02/algorithm008-class02/issues/49#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Falgorithm008-class02%2Falgorithm008-class02%2Fissues%2F49
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://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Falgorithm008-class02%2Falgorithm008-class02%2Fissues%2F49
Sign up https://github.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=algorithm008-class02%2Falgorithm008-class02
Reloadhttps://github.com/algorithm008-class02/algorithm008-class02/issues/49
Reloadhttps://github.com/algorithm008-class02/algorithm008-class02/issues/49
Reloadhttps://github.com/algorithm008-class02/algorithm008-class02/issues/49
algorithm008-class02 https://github.com/algorithm008-class02
algorithm008-class02https://github.com/algorithm008-class02/algorithm008-class02
Notifications https://github.com/login?return_to=%2Falgorithm008-class02%2Falgorithm008-class02
Fork 122 https://github.com/login?return_to=%2Falgorithm008-class02%2Falgorithm008-class02
Star 4 https://github.com/login?return_to=%2Falgorithm008-class02%2Falgorithm008-class02
Code https://github.com/algorithm008-class02/algorithm008-class02
Issues 18 https://github.com/algorithm008-class02/algorithm008-class02/issues
Pull requests 1 https://github.com/algorithm008-class02/algorithm008-class02/pulls
Actions https://github.com/algorithm008-class02/algorithm008-class02/actions
Projects 0 https://github.com/algorithm008-class02/algorithm008-class02/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/algorithm008-class02/algorithm008-class02/security
Please reload this pagehttps://github.com/algorithm008-class02/algorithm008-class02/issues/49
Insights https://github.com/algorithm008-class02/algorithm008-class02/pulse
Code https://github.com/algorithm008-class02/algorithm008-class02
Issues https://github.com/algorithm008-class02/algorithm008-class02/issues
Pull requests https://github.com/algorithm008-class02/algorithm008-class02/pulls
Actions https://github.com/algorithm008-class02/algorithm008-class02/actions
Projects https://github.com/algorithm008-class02/algorithm008-class02/projects
Security https://github.com/algorithm008-class02/algorithm008-class02/security
Insights https://github.com/algorithm008-class02/algorithm008-class02/pulse
New issuehttps://github.com/login?return_to=https://github.com/algorithm008-class02/algorithm008-class02/issues/49
New issuehttps://github.com/login?return_to=https://github.com/algorithm008-class02/algorithm008-class02/issues/49
【问题Q&A】收集https://github.com/algorithm008-class02/algorithm008-class02/issues/49#top
questionFurther information is requestedhttps://github.com/algorithm008-class02/algorithm008-class02/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com/GeekUniversity
https://github.com/GeekUniversity
GeekUniversityhttps://github.com/GeekUniversity
on May 9, 2020https://github.com/algorithm008-class02/algorithm008-class02/issues/49#issue-615121049
https://code-examples.net/zh-CN/q/4e4806https://code-examples.net/zh-CN/q/4e4806
questionFurther information is requestedhttps://github.com/algorithm008-class02/algorithm008-class02/issues?q=state%3Aopen%20label%3A%22question%22
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.