自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(45)
  • 资源 (1)
  • 收藏
  • 关注

原创 Swap all odd and even bits

Given an unsigned integerN. The task is to swap all odd bits with even bits. For example, if the given number is 23 (00010111), it should be converted to 43(00101011). Here, every even position bit i...

2019-12-04 05:54:48 254

原创 248. Count of Smaller Number

Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) and an query list. For each query, give you an integer, return the number of element in the ar...

2019-03-30 22:16:21 288

原创 162. Find Peak Element

A peak element is an element that is greater than its neighbors.Given an input arraynums, wherenums[i] ≠ nums[i+1], find a peak element and return its index.The array may contain multiple peaks,...

2019-03-29 13:19:02 195

原创 278. First Bad Version

You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the...

2019-03-27 02:23:16 102

原创 69. Sqrt(x)

Implementint sqrt(int x).Compute and return the square root ofx, wherexis guaranteed to be a non-negative integer.Since the return typeis an integer, the decimal digits are truncated and only...

2019-03-27 02:04:06 114

原创 33. Search in Rotated Sorted Array

Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e.,[0,1,2,4,5,6,7]might become[4,5,6,7,0,1,2]).You are given a target value to search. If found ...

2019-03-23 23:37:05 91

原创 153. Find Minimum in Rotated Sorted Array

Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7]might become [4,5,6,7,0,1,2]).Find the minimum element.You may assume no du...

2019-03-23 22:58:18 280

转载 转702 Search in a Sorted Array of Unknown Size

Given a big sorted array with positive integers sorted by ascending order. The array is so big so that you can not get the length of the whole array directly, and you can only access the kth number by...

2019-03-23 15:12:59 221

原创 240. Search a 2D Matrix II

Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to right. Integers in each...

2019-03-23 14:52:08 113

原创 74. Search a 2D Matrix

Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from left to right. The first integer of each row...

2019-03-23 13:51:42 108

原创 34. Find First and Last Position of Element in Sorted Array

Given an array of integersnumssorted in ascending order, find the starting and ending position of a giventargetvalue.Your algorithm's runtime complexity must be in the order ofO(logn).If the...

2019-03-19 10:51:59 88

原创 35. Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array....

2019-03-19 03:14:49 84

原创 704. Binary Search

Given asorted(in ascending order) integer arraynumsofnelements and atargetvalue, write a function to searchtargetinnums. Iftargetexists, then return its index, otherwise return-1.Exampl...

2019-03-19 02:11:33 118

原创 LeetCode 3. Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2:...

2019-02-19 04:24:05 76

原创 LeetCode 1.Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same ...

2019-02-19 03:43:29 61

原创 LeetCode 2. Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contains a single digit. Add the two numbers and return ...

2019-02-12 00:41:32 60

原创 LeetCode 107. Binary Tree Level Order Traversal II

/** * Definition for a binary tree node. * public class TreeNode { *     public int val; *     public TreeNode left; *     public TreeNode right; *     public TreeNode(int x) { val = x; } * } ...

2019-02-12 00:11:24 77

原创 LeetCode 111. Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Note: A leaf is a node with no childre...

2019-02-11 23:39:22 69

原创 leetCode 104. Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Note: A leaf is a node with no childre...

2019-02-11 23:34:12 64

原创 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:begin to intersect at node c1. Example 1:Input: ...

2019-02-11 23:26:49 83

原创 LeetCode 349. Intersection of Two Arrays

Given two arrays, write a function to compute their intersection.Example 1:Input: nums1 = [1,2,2,1], nums2 = [2,2]Output: [2]Example 2:Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]Output: [...

2019-02-11 23:25:40 59

原创 LeedCode 350. Intersection of Two Arrays II

Given two arrays, write a function to compute their intersection.Example 1:Input: nums1 = [1,2,2,1], nums2 = [2,2]Output: [2,2]Example 2:Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]Output:...

2019-02-11 23:24:30 58

转载 (转) SQL Server2005 异常处理机制(Begin try Begin Catch)

begin try--SQL end trybegin catch --sql (处理出错动作)end catch我们将可能会出错的sql 写在begin try...end try 之间,若出错,刚程序就跳到紧接着的begin try...end try 的beign catch...end catch中,执行beign catch...end catch错误处理

2014-05-12 15:37:51 453

转载 windows server 2008 中网络中断后出现MSMQ消息队列无法远程发送的问题

windows server 2008 中网络中断后出现MSMQ消息队列无法远程发送问题的解决办法:连上网络后,重启

2014-05-05 10:05:54 2336

原创 解决 手机使用10193 拨打国际长途时候 国际拨号助手 自动增加区号的问题

安卓的手机在往香港拨打长途电话的时候,因为需要使用10193功能,在输入号码后,自动弹出一个对话框---国际拨号助手。例如:我是上海的,拨打香港号码0085228815177,前面加一个10193,拨打的时候,其自动弹出一个对话框说检测我正在拨打国家长途,必须让我选择一个一个国际代码,变成了+852101930085228815177,根本无法实现拨打10193这个省钱功能。 安卓版本4.2

2013-12-20 11:20:23 5321

转载 (转)数据库常规性能检查

查看数据库基本运行信息时 : CPU IO Recompile Select 都是我们要查看的要点。可以利用一下语句进行查看--CPUSELECT TOP  10      total_worker_time AS TotalTime,      total_worker_time/execution_count AS avg_cpu_cost,      plan_han

2013-12-19 14:33:37 377

转载 LPR 最新贷款利率记录

http://www.shibor.org/shibor/web/html/2013-10-25 5.71%2013-10-28 5.72%

2013-10-28 12:17:59 1833

转载 TCP listener

2.TcpListener  TcpListener 类提供一些简单方法,用于在阻止同步模式下侦听和接受传入连接请求。可使用 TcpClient 或 Socket 来连接 TcpListener。可使用 IPEndPoint、本地 IP 地址及端口号或者仅使用端口号,来创建 TcpListener。可以将本地 IP 地址指定为 Any,将本地端口号指定为 0(如果希望基础服务提供程序为您分

2012-11-26 14:52:43 773

转载 转发 tcp server listenner keep alive

在C#中利用Keep-Alive处理Socket网络异常断开的方法分类: C#|MFC专题之Socket 2010-03-25 11:57 560人阅读 评论(0)收藏 举报作者:牧野文章出处:http://www.cnblogs.com/wzd24/archive/2007/05/22/755050.html  网络异常断开原因主要有那些呢?归

2012-11-26 14:50:34 408

转载 SQL server 表导入和导出(转发)

5.BCP实用工具,也就是本文要介绍的,我现在最常用的数据迁移工具。无视大文本的不规则字符,无视大数据量,通过中间文件传输,不必登陆服务器本机。下面就从最简单的例子入手,介绍一下BCP的用法。假设源表名T1,数据库名DB1,服务器器实例为SERVER1,目标表名T2,数据库名DB2,服务器实例为SERVER2。T1和T2的结构完全一样。T2中主键与T1不重复或者直接是空表。首先

2012-07-11 16:41:40 527

转载 在asp.net里怎么跟据用户权限来生成树形菜单

在asp.net里怎么跟据用户权限来生成树形菜单using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using Sy

2012-04-08 22:01:57 627

转载 Windows批处理命令学习

Windows批处理命令学习一     Windows的批处理命令固然比不上unix的shell脚本强大,但用好了仍能给我们的工作带来很大作用。一个朋友问我为什么学习批处理命令,我以《程序员修炼之道——从小工到专家》一书的一句话答复他:图形界面的优点是所见即所得,图形界面的缺点是所见就是所有所得,而批处理命令组合起来功能强大快捷。现在就让我们来学习下吧。(下面红色字为批处理命令) 基本

2012-02-16 14:18:23 538

转载 TortoiseSVN使用

随着应用软件的开发规模及复杂程度日趋大型化,使得软件开发模式从早期的个人作坊式渐渐转变为团队协作开发方式,在这种团队协作的开发模式,为了管理好开发项目,就离不开版本控制软件,在开发过程中采用版本控制软件,能够完整地保存开发中对应用程序每一个源文件所有的修改记录,充分地利用版本控制软件能够对软件开发进行卓有成效的管理。  常见的版本控制软件有VSS、CVS和SVN  VSS(Visual S

2012-02-15 17:16:18 364

转载 转帖 3DEX加密

public static string Encrypt3DES(string strString, string strKey)        {            TripleDESCryptoServiceProvider provider = new TripleDESCryptoServiceProvider();            provider.Key = ne

2012-02-15 12:55:15 1118

转载 c# 调用摄像头抓图(转)

<br /> 1 Imports System<br />  2 Imports System.Runtime.InteropServices<br />  3 Imports System.Drawing<br />  4 Imports System.Drawing.Imaging<br />  5 <br />  6 Public Class CamClass Cam<br />  7 <br />  8     Private Const WM_USER As Int

2011-04-22 17:19:00 1138

转载 axWebBrowser的添加

<br />象其他ActiveX   Control一样,Visual   Studio.Net   IDE工具箱在默认情况下并不直接包含WebBrowser控件。不过,在应用程序中添加该控件很简单。在Visual   Studio.Net   开发环境下,在 "工具箱 "的 "Windows   窗体 "上点击鼠标右键,从弹出的上下文菜单中选择 "自定义工具箱 ",在随后出现的 "自定义工具箱 "对话框的 "com组件 "标签里选中 "Microsoft   Web   浏览器 ",确定后,

2011-03-30 17:52:00 3718 4

转载 生成n位随机字符串(转)

<br /><br />--1、借助newid()<br />go<br />--创建视图(因为在函数中无法直接使用newid())<br />createview vnewid<br />as<br />selectnewid() N'MacoId';<br />go<br />--创建函数<br />createfunction getrandstr(@n int)<br />returnsvarchar(max)<br />as<br />begin<br />    declare

2011-03-25 10:10:00 412

转载 windows API 钩子

<br />使用键盘钩子,调用Win API 函数SetWindowHock。在Hock函数里进行处理。但是,无法勾住Ctrl+Alt+Del。因为他是底层实现的,必须使用键盘驱动才可以实现。示例代码:C# code /************************* //定义变量 public delegate int HookProc(int nCode, Int32 wParam, IntPtr lParam); static int hKeyboardHook = 0; Hook

2011-03-23 16:02:00 1957

原创 2011-03-23web学习发生的问题

win7 vs2008<br />万维网发布服务(w3svc)以停止。除非万维网发布服务(w3svc)正在运行点击"开始"-进入"控制面版"-打开"管理工具"-运行"Internet 信息服务(IIS)管理器"以下重点:在左边栏里 找到你的计算机名字("应用程序池""FTP站点""网站"的最上面哪个) 右键点击-启动----OK---你现在 再启动"网站"!<br /><br />错误摘要HTTP 错误 500.19 - Internal Server Error无法访问请求的页面,因为该页的相关配

2011-03-23 14:37:00 373

转载 在SQL2008中清除日志(转)

<br />(SQL2008):<br /> 在SQL2008中清除日志就必须在简单模式下进行,等清除动作完毕再调回到完全模式。 <br />USE [master]  <br />GO  <br />ALTER DATABASE DNName SET RECOVERY SIMPLE WITH NO_WAIT <br />GO  <br />ALTER DATABASE DNName SET RECOVERY SIMPLE --简单模式  <br />GO  <br />US

2011-03-08 15:48:00 369

OpenGL beginning

OpenGL Beginning test exam report. This draws an 3D object from an OBJ file

2018-07-09

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除