每日一记(1)
设计系统时,如何正确高效地运用并发是一个比较难的问题。以我个人的经验看,大概可以分为以下几个原则:
- 多读单写,单个线程修改,多条线程读取(一般采用队列方式),适用于读多写少的场景;
- 多读多写;多条线程同时读写。这种场景比较复杂,可以采用锁或者hash机制;
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
You may assume the two numbers do not contain any leading zero, except the number 0 itself.
Example:1
2
3Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Output: 7 -> 0 -> 8
Explanation: 342 + 465 = 807.
正己,Java工程师。