求链表的倒数第m个元素

描述:给你一个链表,链表长度为n,链表内各元素为$a1,a2…an,给你一个数m,求链表倒数第m个数是多少。#include<bits/stdc++.h> using namespace std; struct Node{ int Date; struct Node* next; ...

[CareerCup] 2.2 Kth to Last Element of Linked List 链表的倒数第k个元素

2.2 Implement an algorithm to find the kth to last element of a singly linked list. 这道题让我们求链表中倒数第k个元素,LeetCode中相类似的题目有Kth Largest Element in an Array ...

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

社区圈子

数据库
数据库
分享数据库前沿,解构实战干货,推动数据库技术变革
253177+人已加入
加入