上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页
摘要: I thought I know Python... Actually , I know nothing... 这个题真想让人背下来啊,每一句都很帅!!! Given n pairs of parentheses, write a function to generate all combinati 阅读全文
posted @ 2017-01-15 20:07 wilderness 阅读(210) 评论(0) 推荐(0)
摘要: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh 阅读全文
posted @ 2017-01-15 17:26 wilderness 阅读(250) 评论(0) 推荐(0)
摘要: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 题意:求最长回文串。 思路:我是 阅读全文
posted @ 2017-01-14 18:58 wilderness 阅读(128) 评论(0) 推荐(0)
摘要: Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled wit 阅读全文
posted @ 2017-01-14 16:27 wilderness 阅读(150) 评论(0) 推荐(0)
摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文
posted @ 2017-01-14 12:49 wilderness 阅读(138) 评论(0) 推荐(0)
摘要: You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a conca 阅读全文
posted @ 2017-01-14 10:07 wilderness 阅读(159) 评论(0) 推荐(0)
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to 阅读全文
posted @ 2017-01-13 17:06 wilderness 阅读(113) 评论(0) 推荐(0)
摘要: 题意:不用乘除求余运算,计算除法,溢出返回INT_MAX。 首先考虑边界条件,什么条件下会产生溢出?只有一种情况,即返回值为INT_MAX+1的时候。 不用乘除求余怎么做? 一.利用减法。 耗时太长,如果被除数是INT_MIN,除数是1的时候,要循环-INT_MIN次 二.利用位运算 思路来自:ht 阅读全文
posted @ 2017-01-13 12:41 wilderness 阅读(157) 评论(0) 推荐(0)
摘要: 遍历一段文字,统计每个字后面出现的字和其次数,当前一个字确定的时候,计算后一个字出现的百分比,用这个百分比作为文字生成器中后一个字出现的概率进行文字生成 这是利用《百年孤独》第一章的文字作为来源,生成的结果 —————————————————————————————————————————————— 阅读全文
posted @ 2017-01-12 23:13 wilderness 阅读(1936) 评论(0) 推荐(0)
摘要: 再Python中是利用引用计数来实现对象管理和垃圾回收的,即其他对象引用该对象时候,其引用计数加1,反之减1,当引用计数为0时候,被垃圾收集器回收。 Python解释器对对象以及计数器的管理分为以下两步: 1)其引用计数减1 2)判断引用计数是否为0,为0的话,销毁对象 因为使用引用计数,造成两个问 阅读全文
posted @ 2017-01-11 23:37 wilderness 阅读(796) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页