Post, Code and Quiet Time.
  • Home
Sign in Subscribe

Depth First Search

A collection of 3 posts
Trie,

Word Break III

Question http://www.lintcode.com/en/problem/word-break-iii/ Give a dictionary of words and a sentence with all whitespace removed, return the number of sentences you can form by inserting whitespaces to the sentence so that each word can be found in the dictionary. Example Given a String CatMat Given
Nov 28, 2017 1 min read
Depth First Search

House Robber III

Question: http://www.lintcode.com/en/problem/house-robber-iii/ The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. After a tour, the smart thief realized
Nov 7, 2017 1 min read
Depth First Search

Transform the binary search tree into a sorted two-way linked list

Question: Transform the binary search tree into a sorted two-way linked list. do not use recursion. do not create any new node, only adjust the pointer to point. 10 / \ 6 14 / \ / \ 4 8 12 16 -->> 4=6=8=10=12=14=16 struct BSTreeNode { int m_nValue; // value of
Oct 19, 2017 1 min read
Page 1 of 1
Post, Code and Quiet Time. © 2023
Powered by Ghost