一个单词单词字母交换,可得另一个单词,如army->mary,成为兄弟单词。提供一个单词,在字典中找到它的兄弟。描述数据结构和查询过程。#include #include #include using namespace std;void add(unsigned int count[],char ...
分类:
其他好文 时间:
2014-07-07 20:57:31
阅读次数:
244
输入一个字典(用******结尾),然后再输入若干单词。每输入一个单词w,你都需要在字典中找出所有可以用w的字母重排后得到的单词,并按照字典序从小到大的顺序在一行中输出(如果不存在,输出:()。输入单词之间用空格或空行隔开,且所有输入单词都由不超过6个小写字母组成。注意,字典中的单词不一定按字典序排...
分类:
其他好文 时间:
2014-07-07 15:09:56
阅读次数:
372
iOS开发网络篇—JSON介绍一、什么是JSONJSON是一种轻量级的数据格式,一般用于数据交互服务器返回给客户端的数据,一般都是JSON格式或者XML格式(文件下载除外)JSON的格式很像OC中的字典和数组{"name" : "jack", "age" : 10}{"names" : ["jack...
分类:
移动开发 时间:
2014-07-07 14:37:29
阅读次数:
266
什么是JSONJSON是一种轻量级的数据格式,一般用于数据交互服务器返回给客户端的数据,一般都是JSON格式或者XML格式(文件下载除外)JSON的格式很像OC中的字典和数组{“name" : “Jack", “age" : 10}{“name” : [“jack”, “rose”, “jim”]}...
分类:
移动开发 时间:
2014-07-07 13:36:00
阅读次数:
237
第三章Collection Types (集合类型) 在Swift中,提供了两种集合类型用来存储一组值:数组和字典.数组有序的存储相同类型的值;字典存储无序的相同类型的值.字典可以通过唯一的标识(就是所说的键)来查询和访问. 在Swift中,数组和字典总是要清晰的标明他们存储数据的类型....
分类:
移动开发 时间:
2014-06-30 13:26:09
阅读次数:
250
字典树+并查集。 1 #include 2 #include 3 #include 4 5 #define MAXN 500005 6 #define MAXL 11 7 #define TRIEN 26 8 9 typedef struct Trie { 10 ...
分类:
其他好文 时间:
2014-06-30 12:36:50
阅读次数:
224
字典树。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 #define TRIEN 56 9 10 typedef struct Trie {11 Trie *n...
分类:
其他好文 时间:
2014-06-30 11:39:28
阅读次数:
210
【题目】
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
For example, given
s = "leetcode",
dict = ["leet", "code"].
Return true because "leetcode" can be segm...
分类:
其他好文 时间:
2014-06-30 09:02:26
阅读次数:
276
【题目】
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.
Return all such possible sentences.
For example, given
s = "catsanddog",
dict = ["cat", "cats", "and", "sand", "dog...
分类:
其他好文 时间:
2014-06-30 00:51:41
阅读次数:
295
DFS+字典树。题目数据很BT。注意控制DFS深度小于等于len。当'\0'时,还需判断末尾*。另外,当遇到*时,注意讨论情况。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 usin...
分类:
其他好文 时间:
2014-06-29 18:41:17
阅读次数:
160