
算法
文章平均质量分 69
山隐的博客
以身为犁,深耕技术
展开
-
LeeCode刷题之ZigZagConversion JAVA实现
/** * * The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) * * P A H原创 2018-01-23 17:38:54 · 220 阅读 · 0 评论 -
JAVA动态规划学习
前言_我们遇到的问题中,有很大一部分可以用动态规划(简称DP)来解。解决这类问题可以很大地提升你的能力与技巧,我会试着帮助你理解如何使用DP来解题。这篇文章是基于实例展开来讲的,因为干巴巴的理论实在不好理解。注意:如果你对于其中某一节已经了解并且不想阅读它,没关系,直接跳过它即可。简介(入门)基本概念 动态规划过程是:每次决策依赖于当前状态,又随即引起状态的转移。一个决策序列就是在变化的状态转载 2018-01-18 10:37:23 · 1012 阅读 · 0 评论 -
LeeCode刷题之ReverseNodesInKGroup, JAVA实现
/** * Given a linked list, reverse the nodes of a linked list k at a time and * return its modified list. * * k is a positive integer and is less than or equal to the length of the linked * list原创 2018-01-19 13:19:28 · 307 阅读 · 0 评论 -
BigDecimal使用之坑
BigDecimal使用之坑Java中提供了大数字(超过16位有效位)的操作类,即 java.math.BinInteger 类和 java.math.BigDecimal 类,用于高精度计算.其中 BigInteger 类是针对大整数的处理类,而 BigDecimal 类则是针对大小数的处理类.BigDecimal 类的实现用到了 BigInteger类,不同的是 BigDecimal ...原创 2018-02-08 13:25:21 · 1570 阅读 · 0 评论 -
高幂数,快速运算,幂指数散列, JAVA实现方式.
Implement Math.pow(double a,int b)泰勒公式的作用是: 将一个高阶平滑的函数 分解成 若干个低阶平滑函数之和.散列微积分的作用是: 将任意一种函数离散化为多个散列值之和.将y = x离散化: 为例如:x= 100 则可以散列为: 0*2^0 + 0*2^1+ 1*2^2 + 0*2^3 + 0*2^4 + 1*2^5 + 1*2^6原创 2018-02-06 18:09:31 · 507 阅读 · 0 评论 -
【LeetCode】 ValidateBinarySearchTree
/** * Given a binary tree, determine if it is a valid binary search tree (BST). * * Assume a BST is defined as follows: * * The left subtree of a node contains only nodes with keys less than t...原创 2018-03-01 10:07:14 · 180 阅读 · 0 评论