momo's

Cracking LeetCode: 138. Copy List with Random Pointer

May
11

A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list. Thought: Associate the original list and the copy list side by side, and after copying the random pointer, split the original list and the copy […]…

Tech/技术 , , Comments Off on Cracking LeetCode: 138. Copy List with Random Pointer

Cracking LeetCode: 146. LRU Cache

May
11

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) – Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1. put(key, value) – Set or insert the value if the key is […]…

Tech/技术 , Comments Off on Cracking LeetCode: 146. LRU Cache

Cracking LeetCode: 10. Regular Expression Matching

May
10

Implement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The function prototype should be: bool isMatch(const char *s, const char *p)Some examples: isMatch(“aa”,”a”) → false isMatch(“aa”,”aa”) → true isMatch(“aaa”,”aa”) → false isMatch(“aa”, […]…

Tech/技术 , Comments Off on Cracking LeetCode: 10. Regular Expression Matching

一道阿里笔试算法题(1)

Apr
27

今天笔试目测是跪了,单项基本靠蒙,考的范围太广,编程题只写了一道,并且还未答完。 回顾一下两道编程题里的第一道题: 说是有个人在个二维地图上行走,想从(0,0)走到(m,n),当中有许多激光线段(fr…

Tech/技术 , , , , , Comments Off on 一道阿里笔试算法题(1)

Piano Practice

Apr
27

《你的名字》插曲《date》,今天练习1小时!

Study/学习 , , , Comments Off on Piano Practice
Scroll Up