• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
ying_vincent
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 27 下一页
2014年4月6日
Data Structure Array: Find the Missing Number
摘要: http://www.geeksforgeeks.org/find-the-missing-number/1. use sum formula, O(n), O(1)2. use XOR, O(n), O(1)3. use counting sort, O(n), O(1), changing the array4. use negtive, O(n), O(1), chaning the array 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9... 阅读全文
posted @ 2014-04-06 09:55 ying_vincent 阅读(159) 评论(0) 推荐(0)
2014年3月31日
Data Structure Binary Search Tree: Find k-th smallest element in BST (Order Statistics in BST)
摘要: http://www.geeksforgeeks.org/find-k-th-smallest-element-in-bst-order-statistics-in-bst/ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 struct node {12 int data;13 struct node *left, *right;14 node() : data(0), l... 阅读全文
posted @ 2014-03-31 07:31 ying_vincent 阅读(288) 评论(0) 推荐(0)
2014年3月29日
Data Structure Binary Tree: Lowest Common Ancestor in a Binary Tree
摘要: http://www.geeksforgeeks.org/lowest-common-ancestor-binary-tree-set-1/ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 struct node {12 int data;13 struct node *left, *right;14 node() : data(0), left(NULL), right(... 阅读全文
posted @ 2014-03-29 16:35 ying_vincent 阅读(177) 评论(0) 推荐(0)
Data Structure Binary Tree: Print ancestors of a given binary tree node without recursion
摘要: http://www.geeksforgeeks.org/print-ancestors-of-a-given-binary-tree-node-without-recursion/ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 struct node {12 int data;13 struct node *left, *right;14 node() : data(0... 阅读全文
posted @ 2014-03-29 13:50 ying_vincent 阅读(166) 评论(0) 推荐(0)
Data Structure Binary Tree: Convert a given Binary Tree to Doubly Linked List
摘要: http://www.geeksforgeeks.org/in-place-convert-a-given-binary-tree-to-doubly-linked-list/ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 struct node {12 int data;13 struct node *left, *right;14 node() : data(0), ... 阅读全文
posted @ 2014-03-29 11:59 ying_vincent 阅读(188) 评论(0) 推荐(0)
Data Structure Binary Tree: Iterative Postorder Traversal
摘要: http://www.geeksforgeeks.org/iterative-postorder-traversal-using-stack/ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 struct node {12 int data;13 struct node *left, *right;14 node() : data(0), left(NULL), right... 阅读全文
posted @ 2014-03-29 10:16 ying_vincent 阅读(159) 评论(0) 推荐(0)
Data Structure Binary Tree: Largest Independent Set Problem
摘要: http://www.geeksforgeeks.org/largest-independent-set-problem/ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 struct node {12 int data;13 struct node *left, *right;14 node() : data(0), left(NULL), right(NULL) { }... 阅读全文
posted @ 2014-03-29 07:31 ying_vincent 阅读(185) 评论(0) 推荐(0)
Data Structure Binary Tree: Morris traversal for Preorder
摘要: http://www.geeksforgeeks.org/morris-traversal-for-preorder/ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 struct node {12 int data;13 struct node *left, *right;14 node() : data(0), left(NULL), right(NULL) { }15... 阅读全文
posted @ 2014-03-29 07:02 ying_vincent 阅读(179) 评论(0) 推荐(0)
Data Structure Binary Tree: Construct Full Binary Tree from given preorder and postorder traversals
摘要: http://www.geeksforgeeks.org/full-and-complete-binary-tree-from-given-preorder-and-postorder-traversals/ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 struct node {12 int data;13 struct node *left, *right;14 no... 阅读全文
posted @ 2014-03-29 06:46 ying_vincent 阅读(165) 评论(0) 推荐(0)
Data Structure Binary Tree: Boundary Traversal of binary tree
摘要: http://www.geeksforgeeks.org/boundary-traversal-of-binary-tree/ 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 struct node {12 int data;13 struct node *left, *right;14 node() : data(0), left(NULL), right(NULL) {... 阅读全文
posted @ 2014-03-29 04:37 ying_vincent 阅读(173) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 27 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3