![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Algorithm/C++
vwenyu-L
这个作者很懒,什么都没留下…
展开
-
000-algorithm-quick_sort
void sort1(int a[], int first, int last){ if (first< last){ int i = first; int j = last; int x = a[i]; while(i < j){ while (a[j] > x) j--; if (first < last){ a[i] = a[j]; i++;原创 2016-09-03 19:32:25 · 270 阅读 · 0 评论 -
visual studio-third part lib
Configuration Properties -> VC++Directories -> Include Directories(.h) Library Directories(.lib) Linker/Input add .lib nameabout .dll file add directories into Configuration Properties/Debu原创 2017-07-14 22:40:51 · 372 阅读 · 0 评论 -
N/D to float number
#include "stdafx.h"#include#include#include#include#includeusing namespace std;int _tmain(int argc, _TCHAR* argv[]){ int n, d; cin >> n >> d; int tmpn = n; int tmpd = d; int x = 0; w原创 2017-07-12 22:15:02 · 274 阅读 · 0 评论 -
c++/sstream/stoi/
#include#include#includeusing namespace std;stringstream ss;string some("11123");int tmp;ss << some;ss >> tmp;or tmp = std::stoi(some);原创 2016-10-04 13:11:36 · 530 阅读 · 0 评论 -
83. Remove Duplicates from Sorted List
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* de原创 2017-06-09 09:09:03 · 270 阅读 · 0 评论 -
c++-file about
#includeifstream infile(filename.c_str());while( getline( infile, line) ) { }while( infile >> first_position >> second_pos >> ... ) { }原创 2016-10-03 11:28:58 · 555 阅读 · 0 评论 -
003-algorithm-have circle-topology sort
#include#include#includeusing namespace std;bool have_circle(int a[], int m){ vector b(a, a+m*m); map rudu; vector stack; for (int i = 0; i < m; i++) { int tmp(0); for (int j = 0; j原创 2016-09-05 21:49:21 · 444 阅读 · 0 评论 -
002-algorithm-max len sub list with maximum sum
v原创 2016-09-04 20:08:27 · 290 阅读 · 0 评论 -
001-algorithm-print matrix on the clockwise
1 2 34 5 6 ---> 1 2 3 6 9 8 7 4 57 8 9 void print_matrix(int a[], int m, int n){ //matrix a with size m n std::vector x; int point1 = 0; int point2 = n - 1; int point3 = m*n - 1;原创 2016-09-03 21:05:06 · 240 阅读 · 0 评论 -
stack
def calx(op, a, b): if op == 'mul': return str(int(a) * int(b)) elif op == 'add': return str(int(a) + int(b)) elif op == 'div': if b == '0': return 'er原创 2017-07-26 22:20:14 · 340 阅读 · 0 评论