欢迎来到PJCK的博客

随笔分类 -  数据结构与算法----双指针

摘要:Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2019-04-28 18:26 PJCK 阅读(137) 评论(0) 推荐(0)
摘要:Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will only contain 0 and 1. The length 阅读全文
posted @ 2019-04-28 17:35 PJCK 阅读(158) 评论(0) 推荐(0)
摘要:Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another ar 阅读全文
posted @ 2019-04-28 17:15 PJCK 阅读(173) 评论(0) 推荐(0)
摘要:Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, yo 阅读全文
posted @ 2019-04-19 20:47 PJCK 阅读(122) 评论(0) 推荐(0)
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, we use 阅读全文
posted @ 2019-04-14 11:22 PJCK 阅读(189) 评论(0) 推荐(0)
摘要:Given a linked list, remove the n-th node from the end of list and return its head. Example: Note: Given n will always be valid. Follow up: Could you 阅读全文
posted @ 2019-04-14 11:17 PJCK 阅读(183) 评论(0) 推荐(0)
摘要:Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2019-04-14 09:53 PJCK 阅读(138) 评论(0) 推荐(0)
摘要:Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi 阅读全文
posted @ 2019-04-14 09:44 PJCK 阅读(78) 评论(0) 推荐(0)