摘要: 使用ctypes在Python中调用C++动态库 入门操作 使用ctypes库可以直接调用C语言编写的动态库,而如果是调用C++编写的动态库,需要使用 关键字对动态库的函数进行声明: 编译得到动态库,在Python代码中调用: 运行上述代码,得到输出: 尝试传递字符串参数 Python代码调用: 查 阅读全文
posted @ 2018-07-11 21:56 言何午 阅读(1560) 评论(0) 推荐(0) 编辑
摘要: Longest Palindromic Subsequence 题解 题目来源:https://leetcode.com/problems/longest palindromic subsequence/description/ Description Given a string s, find 阅读全文
posted @ 2018-04-10 17:01 言何午 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Single Number 题解 题目来源:https://leetcode.com/problems/single number/description/ Description Given an array of integers, every element appears twice exc 阅读全文
posted @ 2018-04-01 10:23 言何午 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Trapping Rain Water 题解 题目来源:https://leetcode.com/problems/trapping-rain-water/description/ Description Given n non-negative integers representing an e 阅读全文
posted @ 2018-03-01 17:03 言何午 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Sum 系列题解 Two Sum题解 题目来源:https://leetcode.com/problems/two sum/description/ Description Given an array of integers, return indices of the two numbers s 阅读全文
posted @ 2018-02-28 11:38 言何午 阅读(131) 评论(0) 推荐(0) 编辑
摘要: N Queens 系列题解 题目来源: "N Queens" "N Queens II" N Queens The n queens puzzle is the problem of placing n queens on an n×n chessboard such that no two que 阅读全文
posted @ 2018-02-27 00:00 言何午 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Set Matrix Zeroes 题解 题目来源:https://leetcode.com/problems/set matrix zeroes/description/ Description Given a m x n matrix, if an element is 0, set its e 阅读全文
posted @ 2018-02-22 23:42 言何午 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Search in Rotated Sorted Array 系列题解 题目来源: "Search in Rotated Sorted Array" "Search in Rotated Sorted Array II" 第一版 Suppose an array sorted in ascendin 阅读全文
posted @ 2018-02-22 11:57 言何午 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Recover Binary Search Tree 题解 题目来源:https://leetcode.com/problems/recover binary search tree/description/ Description Two elements of a binary search t 阅读全文
posted @ 2018-02-21 16:06 言何午 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Flatten Binary Tree to Linked List 题解 题目来源:https://leetcode.com/problems/ Description Given a binary tree, flatten it to a linked list in place. Examp 阅读全文
posted @ 2018-02-06 22:02 言何午 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Combinations 题解 题目来源:https://leetcode.com/problems/combinations/description/ Description Given two integers n and k, return all possible combinations 阅读全文
posted @ 2018-02-06 15:55 言何午 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Merge Sorted Array 题解 题目来源:https://leetcode.com/problems/merge sorted array/description/ Description Given two sorted integer arrays nums1 and nums2, 阅读全文
posted @ 2018-02-06 13:14 言何午 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Permutations II 题解 题目来源:https://leetcode.com/problems/permutations ii/description/ Description Given a collection of numbers that might contain duplic 阅读全文
posted @ 2018-02-05 13:04 言何午 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Rotate Image 题解 题目来源:https://leetcode.com/problems/rotate image/description/ Description You are given an n x n 2D matrix representing an image. Rotat 阅读全文
posted @ 2018-02-05 09:40 言何午 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Combination Sum 系列题解 题目来源:https://leetcode.com/problems/combination sum/description/ Description Given a set of candidate numbers ( C ) (without dupli 阅读全文
posted @ 2018-02-04 19:54 言何午 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Implement strStr() 题解 题目来源:https://leetcode.com/problems/implement strstr/description/ Description Implement "strStr()" . Return the index of the firs 阅读全文
posted @ 2018-02-04 16:04 言何午 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Plus One 题解 题目来源:https://leetcode.com/problems/plus one/description/ Description Given a non negative integer represented as a non empty array of digi 阅读全文
posted @ 2018-02-03 13:32 言何午 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Minimum Depth of Binary Tree 题解 题目来源:https://leetcode.com/problems/minimum depth of binary tree/description/ Description Given a binary tree, find its 阅读全文
posted @ 2018-02-03 11:42 言何午 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Permutations 题解 题目来源:https://leetcode.com/problems/permutations/description/ Description Given a collection of distinct numbers, return all possible p 阅读全文
posted @ 2018-02-03 11:26 言何午 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Search for a Range 题解 题目来源:https://leetcode.com/problems/search for a range/description/ Description Given an array of integers sorted in ascending or 阅读全文
posted @ 2018-02-03 10:31 言何午 阅读(182) 评论(0) 推荐(0) 编辑
摘要: C++显式类型转换 (注:本文例程改编自《C++ Primer》) 关于类型转换,C++保留了C语言中的类型转换方式,并提供了4中新的类型转换方式。《Effective C++》鼓励我们使用新的转换方式: 第一,它们很容易在代码中被识别出来(不论是人工辨识或使用工具如grep),因而得以简化“找出类 阅读全文
posted @ 2018-02-02 20:05 言何午 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Path Sum 题解 题目来源:https://leetcode.com/problems/path sum/description/ Description Given a binary tree and a sum, determine if the tree has a root to le 阅读全文
posted @ 2018-02-02 17:36 言何午 阅读(91) 评论(0) 推荐(0) 编辑
摘要: Convert Sorted List to Binary Search Tree 题解 题目来源:https://leetcode.com/problems/convert sorted list to binary search tree/description/ Description Giv 阅读全文
posted @ 2018-02-02 16:22 言何午 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Sqrt(x) 题解 题目来源:https://leetcode.com/problems/sqrtx/description/ Description Implement . Compute and return the square root of x. x is guaranteed to b 阅读全文
posted @ 2018-02-02 13:19 言何午 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Pow(x, n) 题解 题目来源:https://leetcode.com/problems/powx n/description/ Description Implement "pow(x, n)" . Example Example 1: Example 2: Solution 阅读全文
posted @ 2018-02-02 10:40 言何午 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Balanced Binary Tree 题解 题目来源:https://leetcode.com/problems/balanced binary tree/description/ Description Given a binary tree, determine if it is heigh 阅读全文
posted @ 2018-02-01 19:34 言何午 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Convert Sorted Array to Binary Search Tree 题解 题目来源:https://leetcode.com/problems/convert sorted array to binary search tree/description/ Description G 阅读全文
posted @ 2018-02-01 16:03 言何午 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Construct Binary Tree from Preorder and Inorder Traversal 题解 题目来源:https://leetcode.com/problems/construct binary tree from preorder and inorder traver 阅读全文
posted @ 2018-02-01 15:31 言何午 阅读(84) 评论(0) 推荐(0) 编辑
摘要: Remove Element 题解 题目来源:https://leetcode.com/problems/remove element/description/ Description Given an array and a value, remove all instances of that 阅读全文
posted @ 2018-02-01 10:57 言何午 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Letter Combinations of a Phone Number 题解 题目来源:https://leetcode.com/problems/letter combinations of a phone number/description/ Description Given a dig 阅读全文
posted @ 2018-02-01 10:31 言何午 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Generate Parentheses 题解 题目来源:https://leetcode.com/problems/generate parentheses/description/ Description Given n pairs of parentheses, write a functio 阅读全文
posted @ 2018-01-31 15:36 言何午 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Valid Parentheses 题解 题目来源:https://leetcode.com/problems/ Description Given a string containing just the characters , , , , and , determine if the inpu 阅读全文
posted @ 2018-01-31 10:17 言何午 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Zigzag Level Order Traversal 题解 题目来源:https://leetcode.com/problems/binary tree zigzag level order traversal/description/ Description Given 阅读全文
posted @ 2018-01-30 16:19 言何午 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Binary Tree Level Order Traversal II 题解 题目来源:https://leetcode.com/problems/binary tree level order traversal ii/description/ Description Given a binar 阅读全文
posted @ 2018-01-30 15:38 言何午 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Partition List 题解 题目来源:https://leetcode.com/problems/partition list/description/ Description Given a linked list and a value x, partition it such that 阅读全文
posted @ 2018-01-30 13:31 言何午 阅读(372) 评论(0) 推荐(0) 编辑
摘要: Container With Most Water 题解 题目来源:https://leetcode.com/problems/container with most water/description/ Description Given n non negative integers a1, a 阅读全文
posted @ 2018-01-30 10:52 言何午 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Longest Common Prefix 题解 题目来源:https://leetcode.com/problems/longest common prefix/description/ Description Write a function to find the longest common 阅读全文
posted @ 2018-01-30 10:03 言何午 阅读(160) 评论(0) 推荐(0) 编辑
摘要: const与指针 当 限定符与指针结合的时候,经常会让人迷惑。本文根据《C++ Primer》上给出的一些解释谈谈自己的理解: 指向常量的指针(pointer to const) 先来看一则书上的示例: 上述示例中, 就是一个指向常量的指针,不能用于改变指向的对象的值。 而要存放一个常量的地址,只能 阅读全文
posted @ 2018-01-29 16:40 言何午 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Reverse Linked List II 题解 题目来源:https://leetcode.com/problems/reverse linked list ii/description/ Description Reverse a linked list from position m to 阅读全文
posted @ 2018-01-29 15:05 言何午 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Reverse Linked List 题解 题目来源:https://leetcode.com/problems/reverse linked list/description/ Description Reverse a singly linked list. Solution 解题描述 这道题 阅读全文
posted @ 2018-01-29 13:09 言何午 阅读(137) 评论(0) 推荐(0) 编辑