原创 leetCode:Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along

原创 leetCode: binary tree sum

題目是:有一顆二叉樹,每個節點都是0~9的一個數字,然後從根節點到葉子節點作爲一個整數,然後把所有葉子節點對應的整數相加#include<iostr

原创 leetCode:Binary Tree Postorder Traversal,Binary Tree Preorder Traversal--JAVA version

Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1

原创 VECTOR in C++:二維數組

 用vector取代C-style的數組          提起數組,大家想必都很熟悉,你可以用索引和指針來操作數組,給程序設計帶來了很大的靈活性。但是你知道它有許多天生的缺陷嗎?        首先,數組的越界可能會引起程序的崩潰(如果

原创 leetCode:Pascal's Triangle II

Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could

原创 leetCode:Single Number

package javatest; import java.util.HashSet; import java.util.Set; public class Solution { private static int MAX=

原创 leetCode:Pascal's Triangle

Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return [ [1],

原创 leetCode:Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solv

原创 leetCode: same tree

Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if th

原创 leetcode generate parentheses

題目 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example,

原创 leetcode題目:reverse words in a string

public class Solution { public static String reverserWords(String s){ String[] Array=s.split(" "); int len=Array.l

原创 HIVE的數據操作

管理表中裝載數據 1 往表中裝載數據的唯一方法是使用一種大量的 數據裝載 操作 hive >load data local path '${env:

原创 HIVE數據庫的基本操作

HIVE的特點:HIVE 不支持行級插入操作、更新操作和刪除操作         HIVE 不支持事物 I 數據庫 1 創建數據庫 hive> cr

原创 Mysql基本用法

#登錄數據庫 mysql -hlocalhost -uroot -p; #修改密碼 mysqladmin -uroot -pold password new;     #顯示數據庫 show databases; #顯示數據表 show

原创 UBUNTU14.04 hadoop搭建的注意事項

hadoop 2.5.0 安裝目錄/usr/local/hadoop-2.5.0 首先是ssh localhost PS: 1如何出現 ssh :