- 博客(126)
- 收藏
- 关注

原创 常见面试题及其解答--问题摘自程序员面试笔试宝典(未完待续)
(1)extern的作用。这个应该分为才C和C++中的区别。C语言中extern声明的函数和变量可以被该文件外部的模块引用,C++中除了该作用以外,还可以声明extern “C”用来表示一段代码编译连接的方法为C语言的方法。1.extern是C/C++语言中声明函数和全局变量作用范围的关键字,改关键字告诉编译器,其声明的函数和变量在本模块或其他模块中使用,通常,在模块的头文件中,对本模块提
2016-04-21 11:52:45
493
转载 Windows下Oracle数据库自动备份批处理脚本
转载地址@echo off REM ########################################################### REM # Windows Server下Oracle数据库自动备份批处理脚本 REM # 使用expdb命令导出需要先在数据库中创建备份文件存贮目录,sql如下:REM # create or replace directory ...
2018-02-12 11:09:51
2264
原创 sql语句中where 1=1 和 where 1 = 0的作用
where 1=1; 这个条件始终为True,在不定数量查询条件情况下,1=1可以很方便的规范语句。一、不用where 1=1 在多条件查询中的困扰 举个例子,如果您做查询页面,并且,可查询的选项有多个,同时,还让用户自行选择并输入查询关键词,那么,按平时的查询语句的动态构造,代码大体如下: string MySqlStr=”select * from table where”
2017-08-28 11:31:07
2598
1
转载 Spring3 MVC 注解---注解基本配置及@controller和 @RequestMapping 常用解释
一:配置web.xml 1)问题:spring项目中有多个配置文件mvc.xml dao.xml 2)解决:在web.xml中 contextConfigLocation /WEB-INF/xxx/*.xml xxx表示xml文件
2017-08-03 14:02:25
555
转载 MyBatis传入参数的问题
一、单个参数 1、基本数据类型 (1)直接使用 List tests(long id); select * from t_charge_rule t where t.id = #{id} #{}中的参数名与方法中的参数名一致 (2)使用注解
2017-08-02 16:06:27
934
原创 opencv中视频的保存(两个版本的)
在对视频进行处理时,很多需要保存处理后的结果,因而想借助于opencv将处理过后的视频保存下来。opencv中保存视频的方式分为 VideoWriter和CvVideoWriter两个版本的,其中前者是对应Mat,后者对应的是IplImage*的。现在多用的是前者,但很多较老的代码中还是用的CvVideoWriter这中方式的,本文对这两种都简要介绍一下。首先是VideoWriter,基本就是将视
2017-03-21 17:26:00
20156
7
转载 HOG:用于人体检测的梯度方向直方图 Histograms of Oriented Gradients for Human Detection
用于人体检测的方向梯度直方图Navneet Dalal,Bill Triggs 摘要 我们研究了视觉目标检测的特征集问题,并用线性SVM方法进行人体检测来测试,通过与当前的基于边缘和梯度的描述子进行实验对比,得出方向梯度直方图(Histograms of Oriented Gradient,HOG)描述子在行人检测方面表现更加突出。我们研究了计
2017-03-16 11:21:11
849
原创 LeetCode : 223. Rectangle Area
问题描述:Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.Assume th
2016-08-30 16:02:19
367
原创 LeetCode : 160. Intersection of Two Linked Lists
问题描述:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘
2016-08-29 17:27:11
412
原创 LeetCode : 136. Single Number
问题描述:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it withou
2016-08-29 17:07:03
394
原创 LeetCode : 389. Find the Difference
问题描述:Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position.Find the lette
2016-08-29 17:02:16
1031
原创 LeetCode 88. Merge Sorted Array
问题描述:Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to
2016-08-26 17:06:59
490
原创 LeetCode 387. First Unique Character in a String
问题描述:Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examples:s = "leetcode"return 0.s = "loveleetcode",return 2.
2016-08-25 11:05:34
447
原创 LeetCode 257. Binary Tree Paths
问题描述:Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->2->5", "1->3"]
2016-08-21 20:41:49
303
原创 LeetCode 225. Implement Stack using Queues
问题描述:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() --
2016-08-18 20:05:47
316
原创 LeetCode: 107. Binary Tree Level Order Traversal II
问题描述:Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,
2016-08-18 18:44:58
288
原创 LeetCode 102. Binary Tree Level Order Traversal
问题描述:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7], 3
2016-08-18 18:41:37
297
原创 剑指offer——面试题3:二维数组中的查找
题目:在一个二维数组中,,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的殊勋排序。请完成一个函数,输入这样一个二维数组和一个整数,判断数组中是否有该整数。示例数组:1 2 8 92 4 9 124 7 10 136 8 11 15分析:若从左上角开始,则该证书可能在当前数字右边,也可能在当前数字下边,并且这两个区域还有重叠。此题从右上角入
2016-08-15 18:57:24
270
原创 LeetCode: 112. Path Sum
问题描述:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tr
2016-08-15 15:44:36
284
原创 LeetCode 110. Balanced Binary Tree
问题描述:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node
2016-08-15 14:12:44
266
原创 LeetCode 119. Pascal's Triangle II
问题描述:Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?分析:
2016-08-14 19:12:14
265
原创 LeetCode 118. Pascal's Triangle
问题描述:Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]分析:规律很简单,二维数组res。
2016-08-14 18:45:26
284
原创 LeetCode 101. Symmetric Tree
问题描述:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \
2016-08-12 17:05:06
235
原创 LeetCode 383. Ransom Note
问题描述:Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can
2016-08-12 15:52:54
1733
转载 LeetCode 337. 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. A
2016-08-12 15:34:26
522
原创 LeetCode 213. House Robber II
问题描述:Note: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention
2016-08-12 13:59:37
243
原创 LeetCode 198. House Robber
问题描述:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adj
2016-08-12 11:24:00
251
原创 LeetCode 121. Best Time to Buy and Sell Stock
问题描述:Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of
2016-08-09 19:55:12
251
原创 LeetCode 152. Maximum Product Subarray
问题描述:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has t
2016-08-09 19:43:40
517
原创 LeetCode 53. Maximum Subarray
问题描述:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous subarray [4
2016-08-09 19:24:23
256
原创 LeetCode 235. Lowest Common Ancestor of a Binary Search Tree
问题描述:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is d
2016-07-27 16:33:03
242
原创 83. Remove Duplicates from Sorted List
问题描述:Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.思路:设定两个节点p和q,其
2016-07-27 10:17:59
247
原创 LEETCode 264. Ugly Number II
问题描述:Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of
2016-07-26 20:59:45
357
原创 LeetCode 263. Ugly Number
问题描述:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not
2016-07-26 20:40:20
212
原创 371. Sum of Two Integers
问题描述:Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return 3.Credits:Special thanks to @fujiaozhu for a
2016-07-21 15:30:20
228
转载 C#常用集合的使用
大多数集合都在System.Collections,System.Collections.Generic两个命名空间。其中System.Collections.Generic专门用于泛型集合。针对特定类型的集合类型位于System.Collections.Specialized;命名空间;线程安全的集合类位于System.Collections.Concurrent;命名空间。
2016-07-15 14:03:05
1100
原创 打开.db的数据库时报错,显示不能在一个关闭的数据集上执行此操作
近段时间学习ndolls框架,其中对sqlite数据库的操作比较多,而sqlite数据库文件不能用一般的工具打开,我就下载了SQLite Administrator ,用SQLite Administrator 打开SQLite数据库,sqlite数据库文件后缀为.db,打开时遇到这个错误网上搜索了下,原因就是我把数据库文件放在了含有中文的路径下,我把它换到我的E盘根目录,在打开就没问题了
2016-07-14 17:51:19
4877
5
原创 LeetCode 206. Reverse Linked List
问题描述:Reverse a singly linked list.单链表反转。AC代码:ListNode* reverseList(ListNode* head) { ListNode *reverseHead = NULL; ListNode *pre = NULL; ListNode *cur = head;
2016-06-24 16:55:27
258
原创 LeetCode 350. Intersection of Two Arrays II
问题描述:Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each element in the result should a
2016-06-24 16:32:59
247
原创 LeetCode 220. Contains Duplicate III
问题描述:Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j] is at most t and the difference betwe
2016-06-24 11:21:59
846
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人