2018年3月18日

内存碎片

摘要: 内存碎片通常分为内部碎片和外部碎片: 1、内部碎片是由于采用固定大小的内存分区,当一个进程不能完全使用分给它的固定内存区域时就产生了内部碎片,通常内部碎片难以完全避免。 2、外部碎片是由于某些未分配的连续内存区域太小,以至于不能满足任意进程的内存分配请求,从而不能被进程利用的内存区域。 段页式内存分 阅读全文

posted @ 2018-03-18 15:49 lina2014 阅读(160) 评论(0) 推荐(0) 编辑

2018年3月17日

MySQL存储引擎InnoDB,MyISAM

摘要: MySQL存储引擎InnoDB,MyISAM1、区别:(1)InnoDB支持事务,MyISAM不支持,对于InnoDB每一条SQL语言都默认封装成事务,自动提交,这样会影响速度,所以最好把多条SQL语句放在begin和commit之间,组成一个事务;(2)InnoDB支持外键,而MyISAM不支持。 阅读全文

posted @ 2018-03-17 18:43 lina2014 阅读(151) 评论(1) 推荐(0) 编辑

SQL注入

摘要: SQL Injection是指通过把SQL命令插入到Web表单递交或输入域名或页面请求的查询字符串,最终达到欺骗服务器执行恶意的SQL命令。具体来说,它是利用现有应用程序,将恶意的SQL命令注入到后台数据库引擎执行的能力,它可以通过在Web表单中输入恶意SQL语句得到一个存在安全漏洞的网站上的数据库 阅读全文

posted @ 2018-03-17 16:59 lina2014 阅读(126) 评论(0) 推荐(0) 编辑

LeetCode 21 Merge Two Sorted Lists 合并两个有序链表

摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:I 阅读全文

posted @ 2018-03-17 16:01 lina2014 阅读(93) 评论(0) 推荐(0) 编辑

2018年3月16日

LeetCode 088 Merge Sorted Array 合并两个有序数组

摘要: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that 阅读全文

posted @ 2018-03-16 18:31 lina2014 阅读(130) 评论(0) 推荐(0) 编辑

2018年3月15日

链表

摘要: 1、单链表的建立 1 #include<iostream> 2 3 using namespace std; 4 5 class ListNode 6 { 7 public: 8 int val; 9 ListNode *next; 10 ListNode(){} 11 ListNode(int x 阅读全文

posted @ 2018-03-15 22:23 lina2014 阅读(165) 评论(0) 推荐(0) 编辑

LeetCode 208 Implement Trie (Prefix Tree) 字典树(前缀树)

摘要: Implement a trie with insert, search, and startsWith methods.Note:You may assume that all inputs are consist of lowercase letters a-z. 阅读全文

posted @ 2018-03-15 17:26 lina2014 阅读(135) 评论(0) 推荐(0) 编辑

LeetCode 101 Symmetric Tree 判断一颗二叉树是否是镜像二叉树

摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetr 阅读全文

posted @ 2018-03-15 11:22 lina2014 阅读(108) 评论(0) 推荐(0) 编辑

2018年3月14日

二叉树

摘要: 1、二叉树的遍历 (1)递归遍历 Java实现: C++实现: 1 #include<iostream> 2 3 using namespace std; 4 5 class TreeNode 6 { 7 public: 8 int data; 9 TreeNode *left; 10 TreeNo 阅读全文

posted @ 2018-03-14 23:49 lina2014 阅读(203) 评论(0) 推荐(0) 编辑

strcpy、strncpy、strlen、memcpy、memset、strcat、strncat、strcmp、strncmp,strchr

摘要: 1、strcpy 2、strncpy 3、strlen (1)非递归实现 (2)递归实现 4、memcpy memcpy 和 strncpy 最大的区别是 memcpy不会遇到 '\0' 结束拷贝 。 (1)version1(不能解决数据区重叠问题): (2)version2(解决了数据区重叠问题) 阅读全文

posted @ 2018-03-14 20:07 lina2014 阅读(408) 评论(0) 推荐(0) 编辑

导航