- 博客(5)
- 收藏
- 关注
原创 基数排序的C++实现
#include <iostream>#include <vector> using namespace std;//传入一个n,返回10的n次方 int my_ten_power(int n){ int power=1; for(int i=0;i<n;i++) power*=10; return power;}//传入一个值num和表示位...
2019-06-30 18:12:06 274
原创 关于链表一些方式的C语言实现
#include <stdio.h>#include <stdlib.h>struct node{ int data; struct node* next;};//创造链表节点,返回链表节点所在指针,传入数据域和指针域 struct node* creatnode(int data,struct node* next){ struct node* p...
2019-06-30 17:15:39 185
原创 LeetCode-42栈算法C++实现
leetcode-42代码如下,使用语言C++使用算法,栈的应用class Solution {public: int trap(vector<int>& height) { int sum=0; stack<int> ts; for(int i=0;i<height.size();i...
2019-06-30 17:05:55 250
原创 LeetCode-42暴力算法C语言实现
leetcode-42代码如下,使用语言C使用算法,暴力算法int trap(int* height, int heightSize){ int i,sum=0; for(i=1;i<heightSize-1;i++) { int j,leftmax=i-1,leftmaxheight=height[i-1],rightmax=i+1,righ...
2019-06-29 21:26:39 686
原创 leetcode-1暴力算法C语言实现
leetcode-1代码如下,使用语言C++使用算法,暴力算法class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { int i,j; for(i=0;i<nums.size()-1;i++) { ...
2019-06-29 21:23:37 785
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人