{"id":5571,"date":"2023-11-24T16:49:55","date_gmt":"2023-11-24T08:49:55","guid":{"rendered":"https:\/\/white-night.club\/?p=5571"},"modified":"2023-11-24T16:51:22","modified_gmt":"2023-11-24T08:51:22","slug":"ad164","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/11\/24\/ad164\/","title":{"rendered":"237.\u00a0\u5220\u9664\u94fe\u8868\u4e2d\u7684\u8282\u70b9"},"content":{"rendered":"\n<p>\u6709\u4e00\u4e2a\u5355\u94fe\u8868\u7684\u00a0<code>head<\/code>\uff0c\u6211\u4eec\u60f3\u5220\u9664\u5b83\u5176\u4e2d\u7684\u4e00\u4e2a\u8282\u70b9\u00a0<code>node<\/code>\u3002<\/p>\n\n\n\n<p>\u7ed9\u4f60\u4e00\u4e2a\u9700\u8981\u5220\u9664\u7684\u8282\u70b9&nbsp;<code>node<\/code>&nbsp;\u3002\u4f60\u5c06&nbsp;<strong>\u65e0\u6cd5\u8bbf\u95ee<\/strong>&nbsp;\u7b2c\u4e00\u4e2a\u8282\u70b9&nbsp;&nbsp;<code>head<\/code>\u3002<\/p>\n\n\n\n<p>\u94fe\u8868\u7684\u6240\u6709\u503c\u90fd\u662f&nbsp;<strong>\u552f\u4e00\u7684<\/strong>\uff0c\u5e76\u4e14\u4fdd\u8bc1\u7ed9\u5b9a\u7684\u8282\u70b9&nbsp;<code>node<\/code>&nbsp;\u4e0d\u662f\u94fe\u8868\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u8282\u70b9\u3002<\/p>\n\n\n\n<p>\u5220\u9664\u7ed9\u5b9a\u7684\u8282\u70b9\u3002\u6ce8\u610f\uff0c\u5220\u9664\u8282\u70b9\u5e76\u4e0d\u662f\u6307\u4ece\u5185\u5b58\u4e2d\u5220\u9664\u5b83\u3002\u8fd9\u91cc\u7684\u610f\u601d\u662f\uff1a<\/p>\n\n\n\n<ul>\n<li>\u7ed9\u5b9a\u8282\u70b9\u7684\u503c\u4e0d\u5e94\u8be5\u5b58\u5728\u4e8e\u94fe\u8868\u4e2d\u3002<\/li>\n\n\n\n<li>\u94fe\u8868\u4e2d\u7684\u8282\u70b9\u6570\u5e94\u8be5\u51cf\u5c11 1\u3002<\/li>\n\n\n\n<li><code>node<\/code>&nbsp;\u524d\u9762\u7684\u6240\u6709\u503c\u987a\u5e8f\u76f8\u540c\u3002<\/li>\n\n\n\n<li><code>node<\/code>&nbsp;\u540e\u9762\u7684\u6240\u6709\u503c\u987a\u5e8f\u76f8\u540c\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u81ea\u5b9a\u4e49\u6d4b\u8bd5\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li>\u5bf9\u4e8e\u8f93\u5165\uff0c\u4f60\u5e94\u8be5\u63d0\u4f9b\u6574\u4e2a\u94fe\u8868&nbsp;<code>head<\/code>&nbsp;\u548c\u8981\u7ed9\u51fa\u7684\u8282\u70b9&nbsp;<code>node<\/code>\u3002<code>node<\/code>&nbsp;\u4e0d\u5e94\u8be5\u662f\u94fe\u8868\u7684\u6700\u540e\u4e00\u4e2a\u8282\u70b9\uff0c\u800c\u5e94\u8be5\u662f\u94fe\u8868\u4e2d\u7684\u4e00\u4e2a\u5b9e\u9645\u8282\u70b9\u3002<\/li>\n\n\n\n<li>\u6211\u4eec\u5c06\u6784\u5efa\u94fe\u8868\uff0c\u5e76\u5c06\u8282\u70b9\u4f20\u9012\u7ed9\u4f60\u7684\u51fd\u6570\u3002<\/li>\n\n\n\n<li>\u8f93\u51fa\u5c06\u662f\u8c03\u7528\u4f60\u51fd\u6570\u540e\u7684\u6574\u4e2a\u94fe\u8868\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><img decoding=\"async\" alt=\"\" src=\"https:\/\/assets.leetcode.com\/uploads\/2020\/09\/01\/node1.jpg\"><strong>\u8f93\u5165\uff1a<\/strong>head = [4,5,1,9], node = 5 <strong>\u8f93\u51fa\uff1a<\/strong>[4,1,9] <strong>\u89e3\u91ca\uff1a<\/strong>\u6307\u5b9a\u94fe\u8868\u4e2d\u503c\u4e3a&nbsp;5&nbsp;\u7684\u7b2c\u4e8c\u4e2a\u8282\u70b9\uff0c\u90a3\u4e48\u5728\u8c03\u7528\u4e86\u4f60\u7684\u51fd\u6570\u4e4b\u540e\uff0c\u8be5\u94fe\u8868\u5e94\u53d8\u4e3a 4 -&gt; 1 -&gt; 9<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 2\uff1a<\/strong><img decoding=\"async\" alt=\"\" src=\"https:\/\/assets.leetcode.com\/uploads\/2020\/09\/01\/node2.jpg\"><strong>\u8f93\u5165\uff1a<\/strong>head = [4,5,1,9], node = 1 <strong>\u8f93\u51fa\uff1a<\/strong>[4,5,9] <strong>\u89e3\u91ca\uff1a<\/strong>\u6307\u5b9a\u94fe\u8868\u4e2d\u503c\u4e3a&nbsp;1&nbsp;\u7684\u7b2c\u4e09\u4e2a\u8282\u70b9\uff0c\u90a3\u4e48\u5728\u8c03\u7528\u4e86\u4f60\u7684\u51fd\u6570\u4e4b\u540e\uff0c\u8be5\u94fe\u8868\u5e94\u53d8\u4e3a 4 -&gt; 5 -&gt; 9<\/p>\n\n\n\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li>\u94fe\u8868\u4e2d\u8282\u70b9\u7684\u6570\u76ee\u8303\u56f4\u662f&nbsp;<code>[2, 1000]<\/code><\/li>\n\n\n\n<li><code>-1000 &lt;= Node.val &lt;= 1000<\/code><\/li>\n\n\n\n<li>\u94fe\u8868\u4e2d\u6bcf\u4e2a\u8282\u70b9\u7684\u503c\u90fd\u662f&nbsp;<strong>\u552f\u4e00<\/strong>&nbsp;\u7684<\/li>\n\n\n\n<li>\u9700\u8981\u5220\u9664\u7684\u8282\u70b9&nbsp;<code>node<\/code>&nbsp;\u662f&nbsp;<strong>\u94fe\u8868\u4e2d\u7684\u8282\u70b9<\/strong>&nbsp;\uff0c\u4e14&nbsp;<strong>\u4e0d\u662f\u672b\u5c3e\u8282\u70b9<\/strong><\/li>\n<\/ul>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color has-link-color wp-elements-aac964ec4ec5a37966a28b52eca67c1a\">\n<p>\u89e3\u9898\u601d\u8def<\/p>\n<cite><em>\u5220\u4e0b\u4e00\u4e2a\u8282\u70b9<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u5b9e\u9645\u4e0a\u5220\u4e0b\u4e00\u4e2a\u8282\u70b9\u5c31\u884c\u3002\u56e0\u4e3a\u6ca1\u7ed9pre\uff0c\u6240\u4ee5\u53ef\u4ee5\u628a\u4e0b\u4e00\u4e2a\u8282\u70b9\u7684\u503c\u590d\u5236\u7ed9\u8981\u201c\u5220\u9664\u201d\u7684\u8282\u70b9\uff0c\u518d\u5220\u6389\u4e0b\u4e00\u4e2a\u8282\u70b9\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\r\n * Definition for singly-linked list.\r\n * type ListNode struct {\r\n *     Val int\r\n *     Next *ListNode\r\n * }\r\n *\/\r\nfunc deleteNode(node *ListNode) {\r\n    node.Val=node.Next.Val\r\n    node.Next=node.Next.Next\r\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1a\u94fe\u8868\u5220\u8282\u70b9<\/p>\n","protected":false},"author":1,"featured_media":2827,"comment_status":"open","ping_status":"","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[42,25],"tags":[38],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/5571"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=5571"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/5571\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/2827"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=5571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=5571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=5571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}