最新 最热

Java常用设计模式--三种工厂模式之简单工厂模式(Simple Factory)

严格的说,简单工厂模式并不是23种常用的设计模式之一,它只算工厂模式的一个特殊实现。简单工厂模式在实际中的应用相对于其他2个工厂模式用的还是相对少得多,因为它只适应很多简单的情况。...

2020-08-13
1

波导断开与菲涅尔反射

前几天一位朋友问我一个问题,光芯片版图里单根波导断开,形成两根波导。两根波导相隔了1纳米,会有什么影响?波导结构示意图如下,WG1与WG2之间相隔的距离为gap,...

2020-08-13
1

并发与竞态 (自旋锁)

由以上介绍大概了解,自旋锁就是内核为防止临界区被多个进程同时访问出错的一种机制。其作用是保证临界区在任一时刻有且仅有一个进程访问。

2020-08-11
1

【每日一题】29. Divide Two Integers

Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.

2020-07-31
1

无处不在的辛普森悖论

1. 简介       Simpson’s Paradox refers to situations in which a trend or relationship that is observed within multiple groups reverses when the groups are combin...

2020-07-30
0

猿进化系列3——看完这个,你就有好几根猴毛了!

不管是啥语言,程序都是按照语句的顺序一行一行执行的!虽然代码看起来和鬼画符差不多,但是这些鬼画符是按照先后次序一行一行执行的!不信你看下面的结果...

2020-07-28
1

按需取余

You are given three integers x,y and n. Your task is to find the maximum integer k such that 0≤k≤n that kmodx=y, where mod is modulo operation. Many programming...

2020-07-27
1

PAT 1049 Counting Ones (30分) 编程之美--1的个数

The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. For example...

2020-07-14
1

PAT 1041 Be Unique (20分)利用数组找出只出现一次的数字

Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen f...

2020-07-14
1

PAT1045 Favorite Color Stripe (30分) 动态规划

Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwant...

2020-07-14
1