![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
betty1121
这个作者很懒,什么都没留下…
展开
-
29. Merge Sort Linked List
Given a singly-linked list, where each node contains an integer value, sort it in ascending order. The merge sort algorithm should be used to solve this problem. Examples null, is sorted to null 1 -> null, is sorted to 1 -> null 1 -> 2 -> 3原创 2021-09-18 16:16:40 · 255 阅读 · 0 评论 -
306. Check If Linked List Is Palindrome
Given a linked list, check whether it is a palindrome. Examples: Input: 1 -> 2 -> 3 -> 2 -> 1 -> null output: true. Input: 1 -> 2-> 3-> null output: false. Requirements: Space complexity must be O(1) 思路:找到中点,在reverse...原创 2021-07-14 16:53:19 · 145 阅读 · 0 评论 -
67. Top K Frequent Words
Given a composition with different kinds of words, return a list of the top K most frequent words in the composition. Assumptions the composition is not null and is not guaranteed to be sorted K >= 1andK could be larger than the number of distinct ..原创 2021-07-10 07:48:51 · 118 阅读 · 0 评论 -
[Java]面试: 如何实现一个不可变类(Immutable class)
https://blog.csdn.net/ToraNe/article/details/103003531转载 2021-07-08 13:20:22 · 125 阅读 · 0 评论 -
Quick Sort
Given an array of integers, sort the elements in the array in ascending order. The quicksort algorithm should be used to solve this problem. Examples {1} is sorted to {1} {1, 2, 3} is sorted to {1, 2, 3} {3, 2, 1} is sorted to {1, 2, 3} {4, 2, -3, 6,.原创 2021-06-28 12:54:45 · 107 阅读 · 0 评论 -
9. Palindrome Number
Given an integerx, returntrueifxis palindrome integer. An integer is apalindromewhen it reads the same backward as forward. For example,121is palindrome while123is not. Example 1: Input: x = 121 Output: true Example 2: Input: x = -121...原创 2021-03-12 19:39:15 · 75 阅读 · 0 评论 -
13. Roman to Integer
Roman numerals are represented by seven different symbols:I,V,X,L,C,DandM. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example,2is written asI...原创 2021-03-12 19:34:13 · 78 阅读 · 0 评论