摘要:
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have 阅读全文
摘要:
题目:n块石头分为若干堆放在一条直线,要求每堆至少有一块石头,相邻两堆数目不同。求所有的分堆方法中,堆中石头大于k的最大的次数。 思路:贪心算法 代码: import java.util.Scanner; public class Main2 { public static void main(St 阅读全文
摘要:
1. wait方法和notify方法 这两个方法,包括notifyAll方法,都是Object类中的方法。在Java API中,wait方法的定义如下: public final void wait() throws InterruptedException Causes the current t 阅读全文