自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 matplotlib柱状图的使用(bar)

使用验证先验概率还是后验概率的实例如下#matplotlib inlinefrom IPython.core.pylabtools import figsizeimport numpy as npfrom matplotlib import pyplot as pltfigsize(12.5, 4)plt.rcParams['savefig.dpi'] = 300plt.rcPara...

2019-11-29 23:19:37 99

原创 C++调试错误总结

目录C++调试错误总结1结构体中定义长的数组会出现覆盖参数的问题C++调试错误总结1你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇文章,了解一下Markdown的基本语法知识。结构体中定义长的数组会出现覆盖参数的问题{ int a; int b; int c[500]; int d; int e;...

2019-10-11 00:06:29 231

原创 Cuda归约运算(一)——分析cudasample的reduction1

何谓归约归约(redution)是一类并行算法,对传入的O(N)个输入数据,使用一个二元的复合结合律的操作符,生成O(1)的结果。这类操作包括取最小、最大、求和、平方求和、逻辑与、逻辑或、向量点积。归约也是其他高级运算中要用的基础算法。除非操作符的求解代价极高,否则归约倾向于带宽受限型任务。下面就从SDK提供的reduction例子入手,详细理解该归约算法。概述因为该二元操作符复合结合律...

2019-03-03 20:39:41 838

原创 Search a 2D Matrix II

文章目录Search a 2D Matrix II题意解释分治的思想Search a 2D Matrix II题意解释大概意思就是采用一种优化算法从M*N行列都从小到大排序好的矩阵中找出目标数。分治的思想采用分治的思想。以题目给出矩阵为例,查找数字5。仔细观察矩阵,最右上角的数字为15,由于矩阵是列递增,所以数字5不可能在最右侧15这一列,我们便可将这一列不予考虑,将范围缩减了一列...

2018-12-25 22:05:23 107

原创 文章标题

strstr函数的实现 首先匹配首字符,然后依次往后匹配,匹配完成的条件是子串的结束符匹配到了,在开始匹配子串之前,将父串所在位置保存。#include <stdio.h>char *strstr(const char *s1, const char *s2){ if(*s2 == '\0') return (char*)s1; for(int i = 0; s

2017-10-08 16:17:25 159

原创 leetcode 113 pathSum2

地址:https://leetcode.com/problems/path-sum-ii/description//** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(in

2017-09-03 16:35:50 209

原创 leetcode112 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 tree and sum =

2017-09-03 15:55:35 263

原创 链表整理

反转链表非递归迭代解法 非递归: 需要三个临时指针; pPrev指向前一个的指针,pnode用来遍历链表的指针,preversedhead用来保存链表的尾节点; 循环遍历的时候首先将pNext保存下来,迭代节点指向前一个节点,更新pPre,迭代下一个节点代码:#include <iostream>using namespace std;ListNode

2017-08-01 14:59:20 157

原创 ATT层容器结构

att服务器数据库数据结构

2017-02-13 15:51:52 378

原创 UVa122 二叉树的层次遍历

主要是将两种内存存储方式写一写,还有使用队列实现的广度优先遍历BFS动态分配内存分配 缺点:容易引起内存泄漏Node* newNode(){ return new Node(); }//使用new的时候就会调用构造函数,给新创建的节点初始化值内存池(队列实现)queue<Node*> freenodes;Node node[maxn];void memory_pool_init(){

2017-01-09 11:03:09 179

原创 使用容器操作单链表并测试

1 单链表的实现 首先是一个最简单的单链表的实现,结构体中存着的是下一个结构体的指针数据结构如下typedef struct linked_item{ struct linked_item *next; //next element in list, or NULL}linked_item_t;typedef linked_item_t * linked_list_t;下面编写单链

2017-01-09 10:28:17 263

原创 内存池的设计

参考了lwip和btstack等开源协议栈的内存池的设计,我来分析一下内存池的设计: 下面是参考的(博主:老衲五木)对lwip动态内存池的理解,这对我理解btstack内存池的分配的理解帮助很大       动态内存池(POOL)分配策略可以说是一个比较笨的分配策略了,但其分配策略实现简单,内存的分配、释放效率高,可以有效防止内存碎片的产生。不过,他的缺点是会浪费部分内存。       为什么

2016-12-16 22:37:30 225

原创 48位蓝牙地址转换成字符串

48位蓝牙地址转换成字符串

2016-12-08 19:19:35 595

intel ipp库使用文档最新

intel ipp库使用文档最新Intel® Integrated Performance Primitives Developer Reference, Volume 1: Signal Processing Intel® Integrated Performance Primitives (Intel® IPP) includes content from several 3rd party sources that was originally governed by the licenses referenced below: • zlib library: zlib.h -- interface of the 'zlib' general purpose compression library version 1.2.8, April 28th, 2013 Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1.The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2.Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3.This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu

2018-12-13

空空如也

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

TA关注的人

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