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) 编辑

导航