小小程序媛  
得之坦然,失之淡然,顺其自然,争其必然
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 34 下一页

2015年10月19日

摘要: 序最近在Ubuntu15.04下做一个Linux-服务器-客户端通信项目,用到MySQL数据库。开始的时候,在数据库链接时遇到障碍,查找资料解决。特此记录,分享于此。环境配置系统:Ubuntu 15.04 IDE:QtCreator 数据库:MySQL (在软件中心,安装服务器端... 阅读全文
posted @ 2015-10-19 20:01 Coding菌 阅读(249) 评论(1) 推荐(0) 编辑
 
摘要: 题目分析按要求转换二叉树;分析转换要求,发现,新的二叉树是按照原二叉树的先序遍历结果构造的单支二叉树(只有右子树)。发现规则,便容易处理了。得到先序遍历,构造即可。AC代码/** * Definition for a binary tree node. * struct TreeN... 阅读全文
posted @ 2015-10-19 13:23 Coding菌 阅读(103) 评论(0) 推荐(0) 编辑
 
摘要: 题目Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the g... 阅读全文
posted @ 2015-10-19 12:53 Coding菌 阅读(104) 评论(0) 推荐(0) 编辑
 
摘要: 序在Linux服务器被攻击的时候,有的时候会有几个主力IP。如果能拒绝掉这几个IP的攻击的话,会大大减轻服务器的压力,说不定服务器就能恢复正常了。在Linux下封停IP,有封杀网段和封杀单个IP两种形式。一般来说,现在的攻击者不会使用一个网段的IP来攻击(太招摇了),IP一般都是散... 阅读全文
posted @ 2015-10-19 10:12 Coding菌 阅读(1634) 评论(0) 推荐(0) 编辑

2015年10月18日

摘要: 题目Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.分析给定有序链表,构造平衡的二叉查找树。与上题本质相同,只不... 阅读全文
posted @ 2015-10-18 13:46 Coding菌 阅读(119) 评论(0) 推荐(0) 编辑
 
摘要: 题目Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the... 阅读全文
posted @ 2015-10-18 13:09 Coding菌 阅读(260) 评论(0) 推荐(0) 编辑

2015年10月17日

摘要: 题目Given an array where elements are sorted in ascending order, convert it to a height balanced BST.分析给定一个有序序列,构造一颗平衡的二叉查找树。思想:序列中值构造根节点,递归,前半... 阅读全文
posted @ 2015-10-17 13:29 Coding菌 阅读(132) 评论(0) 推荐(0) 编辑
 
摘要: 题目Given inorder and postorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.Sh... 阅读全文
posted @ 2015-10-17 13:14 Coding菌 阅读(92) 评论(0) 推荐(0) 编辑

2015年10月15日

摘要: 题目Given preorder and inorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.分析给... 阅读全文
posted @ 2015-10-15 15:55 Coding菌 阅读(148) 评论(0) 推荐(0) 编辑
 
摘要: 题目Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note: A solution using O(... 阅读全文
posted @ 2015-10-15 14:45 Coding菌 阅读(175) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 34 下一页