1 Android 安全机制概述 Android 是一个权限分离的系统 。 这是利用 Linux 已有的权限管理机制,通过为每一个 Application 分配不同的 uid 和 gid , 从而使得不同的 Applic…
Java8中的forEach方法详解
在Java中我们需要处理Clloection的时候,通常需要创建一个Iterator实例来对集合进行迭代,在迭代中对每个或者某些元素进行业务逻辑的操作。如果迭代使用不当的话,则会抛出ConcurrentModificat…
php中的设计模式之--门面模式
<?php /** (1)外观模式(Facade)也叫门面模式,为子系统中的一组接口提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。 为一些复杂的子系统提供一组接口 (2)主要角色…
试分别以顺序表和单链表作存储结构,各写一实现线性表就地逆置的算法
对数组的倒置 void SeqList<DataType>::inversion() { int i = 0, j = length - 1; DataType temp; while(i < j) {…
NYOJ 221 Tree (二叉树遍历)
题目221 题目信息 运行结果 本题排行 讨论区 Tree 时间限制: 1000 ms | 内存限制: 65535 KB 难度: 3 描述 Little Valentine l…
LeetCode总结-K-Sum问题
最近在刷 LeetCode 上的题为找工作提前做准备,在刷 Array 类问题的 Easy 难度的题的时候觉得还好,大部分的题还是能够想得出来,但是在刷到 Medium 难度的时候,明显感觉难度提升了,其中有一类题型连续…
Leetcode. Add N Sum类问题
今天无意中听到同事面试, 问到了add n sum类的问题. 想到leetcode上有很多类似的问题, 特地整理一下。 Q1: 2Sum Given an array of integers, return indice…
算法: Sum of left Leaves
Sum of left Leaves 计算二叉树种所有叶子左叶子节点的值的总合 /** * Definition for a binary tree node. * public class TreeNode { * p…
709. To Lower Case
描述 Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.…
399. Evaluate Division
https://leetcode.com/problems/evaluate-division/ 输入为: equations = [ ["a", "b"], ["b", "c"] ], values = [2.0, 3…
三刷98. Validate Binary Search Tree
Medium 三刷还是没写出来,醉了。总的思路就是限定范围,这里用Integer type来定义范围,可以解决给的root的范围不知道的问题。 /** * Definition for a binary tree nod…
Leetcode 137.Single Number II
Given an array of integers, every element appears three times except for one, which appears exactly once. Find…