javalruleetcode-leetcode:解决方案

时间:2024-07-19 15:54:06
【文件属性】:

文件名称:javalruleetcode-leetcode:解决方案

文件大小:186KB

文件格式:ZIP

更新时间:2024-07-19 15:54:06

系统开源

java lru leetcode Leetcode Just want to push myself to practice coding Readme 里面并没有列出所有的题目的解法,只列出一些比较经典的 # Title Solution Basic idea (One line) n sum 1 1. HashMap O(n) and O(n) space.2. Sort with two points O(nlogn) and O(1) space. 167 1. two pointers O(n) 2. binary search O(log(n!)) 170 Use HashMap to store numbers. Maintain a list with distinct elements. 653 1. DFS + HashSet Time: O(n), Space: O(n).2. Inorder traversal + two pointers Time: O(n), Space: O(n) 3. BST iterator + stack Time: O(n),


网友评论