leetcode---Kth Smallest Element in a Sorted Matrix

Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.Note that it is th...

2016-08-28 13:46:48

阅读数:320

评论数:0

leetcode---Ransom Note

Given
 an 
arbitrary
 ransom
 note
 string 
and 
another 
string 
containing 
letters from
 all 
the 
magazines,
 write 
a 
function 
that 
will 
ret...

2016-08-28 12:14:39

阅读数:367

评论数:0

随机洗牌

//产生[low, high)之间的随机数 int randval(int low, int high) { int val; val = floor( ((double)(rand()%RAND_MAX)/RAND_MAX)*(hi...

2016-08-28 10:56:55

阅读数:338

评论数:0

leetcode---Lexicographical Numbers

Given an integer n, return 1 - n in lexicographical order.For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9].Please optimize your algorit...

2016-08-27 19:39:32

阅读数:496

评论数:0

leetcode---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....

2016-08-27 16:28:19

阅读数:376

评论数:0

STL---string用法

#include "iostream" #include "vector" #include "string" #include "sstream"using namespace std;int main() { ...

2016-08-27 15:52:47

阅读数:452

评论数:0

leetcode---Water and Jug Problem

You are given two jugs with capacities x and y litres. There is an infinite amount of water supply available. You need to determine whether it is pos...

2016-08-25 00:39:09

阅读数:281

评论数:0

leetcode---Valid Perfect Square

Given a positive integer num, write a function which returns True if num is a perfect square else False.Note: Do not use any built-in library functio...

2016-08-25 00:07:36

阅读数:170

评论数:0

leetcode---Longest Increasing Subsequence---动规

Given an unsorted array of integers, find the length of longest increasing subsequence.For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest...

2016-08-24 00:14:15

阅读数:176

评论数:0

MFC---利用标题对列表进行排序

1、新建基于MFC对话框的工程:myList 2、在工程中添加基于ClistCtrl的新类MyListCtrl 3、在对话框中添加ListContrl控件,打开 Class Wizard,添加控件对应变量m_mylist,继承自MyListCtrl类;在myList.h中添加头文件:MyLis...

2016-08-22 23:49:01

阅读数:1463

评论数:1

Qt---自定义对话框形状、移动窗体

mainwindow.h#ifndef MAINWINDOW_H #define MAINWINDOW_H#include <QMainWindow> #include <QLabel> #include <QMouseEvent>namespace Ui { ...

2016-08-22 22:55:27

阅读数:1285

评论数:0

Qt---按钮

QPushButton *btn = new QPushButton("是", this); QPixmap pmpBg(":/btn1.png"); btn->setFixedSize(pmpBg.width(), pmpBg.hei...

2016-08-10 20:41:33

阅读数:620

评论数:0

Qt---Label

1、右键项目,选择”添加新文件”,选择“Qt”–>”Qt Resoruce File”,从而添加了资源文件夹。 2、右键“资源”文件夹,选择“add Prefix”,新建一个文件“Pictures”,右键,选择“添加现有文件夹”,选择一幅图片。 3、右键图片,选择Copy Path,复制...

2016-08-10 20:10:01

阅读数:1517

评论数:0

MFC---多种方式显示位图

一、控件方式1、将要显示的位图b.bmp放在res文件夹下 2、右键工程,选择“Insert”,选择Bitmap,这时工程中新添了Bitmap文件夹 3、右键Bitmap文件夹,选择“Import Bitmap”,选择b.bmp,这时Bitmap文件夹下新建了IDB_BITMAP1 4、在对...

2016-08-09 20:08:19

阅读数:2642

评论数:0

MFC---自定义消息

1、新建MFC基于对话框工程,名称为myMessage2、在StdAfx.h中定义消息#define WM_MY_MESSAGE (WM_USER + 100)3、在类的头文件myMessageDlg.h中,添加消息处理函数的声明:protected: HICON m_hIcon; ...

2016-08-09 19:26:43

阅读数:384

评论数:0

MFC---AnimateWindow实现窗口动画效果

转自: http://www.cnblogs.com/phinecos/archive/2007/07/16/820309.html在窗体初始化函数,如OnInitDialog()中添加:CenterWindow(); //窗口居于屏幕正中央 AnimateWindow(GetSafeHwnd...

2016-08-08 20:59:18

阅读数:3344

评论数:0

Qt---为窗体添加滚动条:QScrollArea

#include "mainwindow.h" #include "ui_mainwindow.h" #include <QScrollArea> #include <QPushButton>MainWindow::MainWindo...

2016-08-08 20:35:32

阅读数:17094

评论数:0

MFC---Tab控件

1、建立基于对话框的MFC工程,名称为tab2、从工具箱中将Tab控件拖到窗体中,关联变量:m_tab,类型:CTabCtr。 3、插入两个对话框:IDD_DIALOG1、IDD_DIALOG2,分别建立类向导,类名称为:CDialog1,CDialgo2。将对话框属性设为:样式–>下层(...

2016-08-08 20:08:53

阅读数:330

评论数:0

leetcode---Group Anagrams---哈希

Given an array of strings, group anagrams together.For example, given: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”], Return:[ [“ate”, “eat”,”tea”]...

2016-08-07 13:07:38

阅读数:194

评论数:0

Qt---QFtp上传、下载二进制文件

#include "mainwindow.h" #include "ui_mainwindow.h" #include <QFtp> #include <QDebug> #include <QFile> #include ...

2016-08-06 12:20:55

阅读数:1472

评论数:2

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