CMake 入门及常用变量指令手册
实战 参考《CMake Practice》。 项目目录结构 我们项目的名称为CRNode,假设我们项目的所有文件存放再~/workspace/CRNode,之后没有特殊说明的话,我们所指的目录都以此目录为相对路径。 我们的目录结构如下: ~/workspace/CRNode
├─ src
│
算法
未读
LeetCode 6 ZigZag Conversion(Z字转换)
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font
算法
未读
LeetCode 106 Construct Binary Tree from Inorder and Postorder Traversal(由中序和后序遍历建立二叉树)
Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. For example
算法
未读
LeetCode 5 Longest Palindromic Substring(最长回文字串)
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: "babad"
Output:
算法
未读
LeetCode 8 String to Integer (atoi)
Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-white
iOS
未读
Objective-C Type Encodings
Objective-C Type Encodings 转自:nshipster,觉得再某些场景上有点用,就直接抄过来了。 @encode,@编译器指令 之一,返回一个给定类型编码为一种内部表示的字符串(例如,@encode(int) → i),类似于 ANSI C 的 typeof 操作。苹果的 O
iOS
未读
Objective-C:为什么分类中不能直接添加属性
为什么分类中不能直接添加属性,这个也是一个经典的面试题了。 搜了一些相关文章,再结合源码做了一个小小的总结。 其实通过这个问题,也可以一瞥 OC 中类的实现。 源码 先晒一下OC类和分类的部分源码: typedef struct objc_class *Class;
struct objc_cla
算法
未读
数据结构与算法解析习题2.23
数据结构与算法解析习题2.23:实现对分查找使得在每次迭代中只有一个二路比较 这个题目说每次迭代只有一个二路比较不太明确是什么意思,我觉得应该是只比较一次吧,那就把判断mid的逻辑放在迭代之后了。 也不知道这么理解对不对,希望有明白人给解解惑。。
#include <stdio.h>
int
算法
未读
数据结构与算法解析习题2.19
数据结构与算法解析习题2.19:寻找主要元素 Majority Element 题干:大小为N的数组,其主元素是一个出现超过N/2的元素。 首先找出主元素的一个候选元,第二步确认该候选元是否为主元素。为找出数组A中的候选元,先构造一个数组B,比较A1和A2,如果相等,则放入到数组B中,然后比较A3和