標籤:Java 概述Java 的三大平台 a Java SE (a Java m Platform d Standard Edition) ) :Java 標準平台,它允許開發和部署在案頭、伺服器、嵌入式環境和即時環境中使用的 Java 應用程式,如做一個案頭版的 QQ,JavaSE 能為 Java EE 和 JavaME 提供開發基礎。 a Java EE (a Java m
標籤:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a palindrome.解題思路:注意題目,忽略大小寫,忽略非字母或數字,JAVA實現如下:
標籤:96:Given n, how many structurally unique BST‘s (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST‘s. 1 3 3 2 1 \ / / / \
標籤:習題1、bubbleSort.java程式(清單3.1)和BubbleSort專題applet中,in索引變數都是從左到右移動的,直到找到最大資料項目並把它移動到右邊的out變數外。修改bubbleSort()方法,使它成為雙向移動的。這樣,in索引先像以前一樣,將最大的資料項目從左移到右,當它到達out變數位置時,它迴轉並把最小的資料項目從右移到左。需要兩個外部索引變數,一個在右邊(以前的out變數),另一個在左邊。 public static void bubbleSort(int
標籤:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree. For example:Given the below binary tree, 1 / 2 3Return 6.解題思路:DFS暴力枚舉,注意,如果採用static 全域變數的話,在IDE裡面是可以通過,但在OJ上無法測試通過,因此需要建立一個類來儲存結果,
標籤:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at most two transactions.Note:You may not engage in multiple transactions at the same time (ie,