十七ing
十七ing
全部文章
题解
归档
标签
去牛客网
登录
/
注册
十七ing
程序员小白
全部文章
/ 题解
(共9篇)
题解 | #删除链表中重复的结点#
public class Solution { public ListNode deleteDuplication(ListNode head) { ListNode newhead = new ListNode(-1); ListNode temp = ne...
Java
2022-04-29
0
218
题解 | #链表分割#
public class Partition { public ListNode partition(ListNode head, int x) { //1. 创建五个指针 //创建两个傀儡节点 newhead1 和 newhead2 //再创...
Java
链表
2022-04-29
1
401
题解 | #删除链表中重复的结点#
public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; } } */ public class Solution { ...
Java
2022-04-26
0
287
题解 | #链表中倒数第k个结点#
public ListNode FindKthToTail(ListNode head,int k) { if(head == null || k <= 0 ){ return null; } //快慢指针 ...
Java
2022-04-25
0
268
题解 | #链表中倒数第k个结点#
public ListNode FindKthToTail(ListNode head,int k) { ListNode cur = head; ListNode sign = head; int count = 0; while(c...
Java
2022-04-25
0
254
题解 | #X形图案#
public class Main{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); while(scanner.hasNext()){ ...
Java
2022-04-17
0
305
题解 | #Fibonacci数列#
int main(void) { int a = 0; int b = 1; int c = 1; int n = 0; scanf("%d", &n); while (1) { if (n == b) { printf("0\n"); break; }...
C
2022-04-13
0
362
题解 | #替换空格#
class Solution { public: void replaceSpace(char *str,int length) { int new_length = 0; int space = 0; char* start = str; while (*start !...
C++
2022-04-12
0
268
题解 | #序列中删除指定数字#
#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> int main(void) { int arr1[20] = { 0 }; int arr2[20] = { 0 }; int n = 0; int ...
C
2022-04-10
1
334