Da's blog
  • 主页
  • 归档
  • 分类
  • 关于
  •   
  •   
寻宝与压缩状态dp

寻宝与压缩状态dp

压缩状态的dp与记忆化存储当我们面对多个不同状态有笛卡尔积个可能性时,即$2^n$个状态时,如果只使用平凡的空间来存储,那么空间复杂度是非常爆炸的。目前,有一种使用Unix中会用到的mask手法来压缩dp的状态空间占用。如果我们的状态个数n小于32时,我们通常会采用这种方法来对dp算法进行优化。通常,也会伴随记忆化存储来进优化时间。 这里,我挑选了一题,其非常具有代表性,可以灵活用到mask以及记

2020-08-05
java
算法
GTD:给自己一个玩的机会

GTD:给自己一个玩的机会

序在讨论GTD工作法之前,设想一下这样一个场景。你是一名996公司员工,每天行走在公司与家的两点一线。周一到周六每天早上七点半,闹钟的夺命追魂call响了。你很不情愿的拍向手机闹钟,在闹钟第三次声音想起时,你潜意识在警告你,再不醒,就迟到了,这个月的全勤奖想都不要想!你艰难地起床,洗漱,出门前想起无休止的工作以及马上要挤的地铁,无声地叹了口气。 在家到公司的地铁上,你刷手机,羡慕别人靓丽的生活。大

2020-06-13
工作
二分搜索树拾遗

二分搜索树拾遗

二分搜索树拾遗假设我们需要在一个有序的数组内,查找一个数,那么首先想到使用二分搜索的方法。二分搜索具有非常优秀的时间复杂度O(logN),这在许多算法中都会优先使用。如果情况变得再复杂些,有一个无序的数组,我们应该使用什么样的算法来查找其中某一项呢? 这时,可以考虑二分搜索树,一个符合期望的二分搜索树,其最小的深度为O(logN),也就是说,我们同样可以用过O(logN)的时间复杂度来实现搜索操作

2020-05-11
java

Overview of system program design

Lecture 1 关于C 一个函数体内支持多少个参数?31?? 在一次函数调用是支持多少个argument? 31个 一行最多支持多少个character?80 characters is likely to be inadaquate for programming styles with large indentations and/or verbose variable names.

2018-01-16
c

Kotlin迭代器的使用

Iterator and Iterable interface in kotlin以前一直不理解Iterable与Iteration的关系,在kotlin的语法里面,正好可以区别开。iterable是一个接口,需要一个函数实现它,并实现它的iterator方法,返回一个真正的iterator类。具体的迭代应该怎么做,需要传一个继承iterator接口的类。 示例: 1data class MyDa

2018-01-10

CMM Interpreter

CMM的语法CMM是c的一个子集,其中实现了int, double类型的变量声明,赋值以及其他数值运算操作。同时可以识别true ,false关键字(布尔值运算时,认为0是false,所有非零的数为true)。 123int a = 1,b=2,c=3;double f = 1.4,ff=1.45;a = ((1+1)*(1+1))*((1+1)*(1+1)); 同时也实现了一维数组的声明、赋值

2017-12-18
java

Cache Lab

A Brief introduction to cacheProcessors are generally able to perform operations on operands faster than the access time of large capacity main memory. Though semiconductor memory which can operate at

2017-12-18
c

Profiling

Analyze the bottlenecks Before running the program, what I focus on to optimize is codes related to String, malloc, and high time complexity. I notice the index operation in the program and my guess p

2017-11-30
c++

Profiling Tools

Here I give four different kinds of Java profiler tools. TPTP CodePro Profiler YourKit Profiler JProfiler TPTPTPTP ( Test and Performance Tools Platform) is a official plugin provided by eclipse. It

2017-11-30
java

Allocator

Build a simple mallocIn Linux, a program asks sbrk or brk for space, which increase the heap size and return to a pointer to the start of the new region on the heap. Also, when a program calls malloc(

2017-11-20
c
1234

Suchen

Hexo Fluid