Learn | Record

Eryn Meng's blog | 边走边看 边看边学 边学边练

Basic Coding Problem

必须掌握的基础题型

必背 Questions Array Array里面元素的type, Array是否null?(空集时返回什么值?)数据的大小0-n? 是否有负数negative? array长度? input is n type: string, char, int, double/f negative/positive ListNode structure {}, circle? TreeNo...

'LinkedList' in Java

理解Java中的链表

LinkedList LinkedList cycle 检测链表中是否有环/环的入口 第一次快指针(一次两步)和慢指针(一次一步)一起从头开始走 第一次相遇的点Pos意义:快指针走的路程是慢指针的两倍 快指针路程 (LenA + x + y + x) = 2 * (LenA + x) 慢指针路程 所以得到:y + x = LenA + x 所以 y...

General Questions in a Coding Interview

技术面试中的常规问题

1. 判断奇偶数 考虑复数 问input有什么情况 考虑coding style 和 精简 i%2==1是平时判断奇数的常用方法,这个方法有个弊端就是当i为负数的时候,判断结果是错误的,因为在java中,%运算的结果和左操作数具有相同的符号。 改进的方法有两种 i%2!=0,这样即使是负的奇数也可以正确的判断 i&1!=0,奇数的最后一位总是1,这样和1...

'final'variable in Java

理解Java中的final

参考!iostream123 final ” If the final variable is a reference, this means that the variable cannot be re-bound to reference another object, but internal state of the object pointed by that refer...