ARTS #62 | 不要只顾低头赶路 Algorithm 本周选择的算法题是:Implement Queue using Stacks 规则如下: Implement the following operations of a queue using stacks. push(x) – Push element x to the back of queue. pop() – Removes the elemen...
ARTS #61 | 性能优化就是从限制到极致 Algorithm 本周选择的算法题是:Kth Largest Element in an Array 规则如下: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct ele...
如何系统性的做好高性能优化 “如果你无法衡量它,那么也无法改善它。“ – Lord Kelvin 性能优化就是在各种限制条件下达到极致的过程。 性能测试是优化的前提和基础,也是性能优化结果的检查和度量标准。 性能测试的第一步,先定义性能指标,从客观性能的角度来看,性能指标包括: 响应时间 客户端程序最直观的体现就是卡不卡 服务端程序最直观的体现就是从发出请求到收...
ARTS #60 Algorithm 本周选择的算法题是:Implement strStr() 规则如下: Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: hay...
ARTS #59 Algorithm 本周选择的算法题是:Median of Two Sorted Arrays 规则如下: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time co...
软件架构设计 架构设计能力,因掌握起来困难而显得珍贵。 这是对《软件架构设计》的读后感,看完这本书让我知道:我不是一名合格的架构师。我目前的职责“基础组件的开发和设计”、“已有代码的优化 & 重构”仍然没有跳出开发者的视角,架构师当然也要写代码、了解业务,但不能仅限于此,要深挖产品需求、掌握架构设计的方法、完整的领域知识和技术的实现细节。 从本书描述的架构角色来看,我的职责更侧重于系统...
ARTS #58 Algorithm 本周选择的算法题是:Goat Latin 规则如下: A sentence S is given, composed of words separated by spaces. Each word consists of lowercase and uppercase letters only. We would like to convert the sente...
Swift 内存管理 从编译器的视角看 Swift 的内存管理 思维导图: xmind 文字资料 Swift 4- ARC 原理 在 SIL 阶段插入 swift_retain()、 swift_release() 完成内存管理 weak 引用会转换成 swift_weakAssign() unowned 引用会转换成 unowned_...
DNS 的用武之地 DNS 除了做域名解析,还能干啥 思维导图: xmind 文字资料 域名解析 通过 DNS 服务器返回对应的 IP 地址 智能 DNS 资源的就近访问 根据用户 IP 返回最近的服务器地址 实现方式 ...
ARTS #57 Algorithm 本周选择的算法题是:Kth Smallest Element in a Sorted Matrix 规则如下: Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matr...