c语言算法
mask1234567
这个作者很懒,什么都没留下…
展开
-
八皇后问题c语言算法
八皇后问题c语言算法原创 2017-03-30 20:52:20 · 6879 阅读 · 1 评论 -
LeetCode:Longest Palindromic Substring最长回文字符串
题目: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: “babad” Output: “bab”Note: “aba” is also a valid answer. E原创 2017-04-09 17:03:12 · 236 阅读 · 0 评论 -
LeetCode:ZigZag Conversion
题目描述 The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H N A P L S原创 2017-04-10 11:18:30 · 220 阅读 · 0 评论 -
马踏棋盘算法
问题定义: 将马随机放在国际象棋的Board[0~7][0~7]的某个方格中,马按走棋规则进行移动。,走遍棋盘上全部64个方格。编制非递归程序,求出马的行走路线,并按求出的行走路线,将数字1,2,…,64依次填入一个8×8的方阵,输出之。思路: 利用回溯法的思想,马的走法总共有8,c[8]={1,2,1,2,-1,-2,-1,-2},b[8]={2,1,-2,-1,2,1,-2,-1},c是横坐标原创 2017-03-31 22:50:59 · 1069 阅读 · 0 评论 -
LeetCode:String to Integer (atoi)没你想的那么简单
题目: Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca原创 2017-04-10 21:16:35 · 336 阅读 · 0 评论