
C++
Jie Ou
学习
展开
-
【LeetCode】 Remove Nth Node From End of List 【python C++】做法详解
题目,从listnode 中删除倒数第n个点Given a linked list, remove the n-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the sec...原创 2018-11-15 21:13:11 · 145 阅读 · 0 评论 -
【LeetCode】 4Sum 【Python C++】
题目:从给定的一堆数字中找出 所有 4个数之和=taget的组合。组合与组合之间不得重复Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique qua...原创 2018-11-14 11:25:40 · 126 阅读 · 0 评论 -
python 打包成 so | python 调用cpp | python 调用C++简单例子
一、写一个cpp这个cpp的功能是 “加法器”,extern “C”的存在是因为python 的ctype可以调用C但是没有Cplustype~~~所以,~~~#include "/home/oujie/anaconda3/envs/pytorch-master/include/python3.7m/Python.h"#功能实现在这个函数中extern "C"int add_fu...原创 2019-01-08 20:39:15 · 2751 阅读 · 0 评论 -
【李航-统计学习方法】【原理与代码】第四章 朴素贝叶斯 Naive Bayes python C++
一、原理: 朴素贝叶斯必须要有的先决假设:特征条件独立,意思就是 X这个特征向量中的x1,x2,x3.。。。等,相互之间都是条件独立的。 先验概率: 条件概率: 根据条件独立这个假设,可以得到如下条件概率的计算方式: ...原创 2019-04-09 00:36:50 · 511 阅读 · 0 评论 -
【李航-统计机器学习】【原理及代码】【第二章】 感知机模型 python C++
一、原理: 感知机的“非对偶”还是比较容易理解的,输出的Y只有 +1 和 -1 两个选择。 公式:,其中w是权重,b是偏置 其中sign算是个激活函数: 线性方程: 这个对应空间中的一个超平面 ...原创 2019-04-03 17:04:18 · 368 阅读 · 0 评论