發表文章

Genymontion 無法開啟虛擬機@解決

圖片
Unable to start the virtual device. VirtualBox cannot start the virtual device. To find out the cause of the problem, start the virtual device from VirtualBox. For more information, check the log files. Please refer to:  https://www.genymotion.com/#!/support?chapter=collapse-logs#faq 這是我這次遇到的問題,簡單來說,連Genymotion也不知道原因為什麼開不起來。所以我嘗試到處找了幾個方法,逛過 Stack overflow 和一些中文部落格,把所有的可能解決的方法都記錄下來,當作一個經驗或筆記。

Leetcode:Invert Binary Tree

Invert Binary Tree Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 Trivia: This problem was inspired by this original tweet by Max Howell : Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.

Leetcode:Number of 1 Bits

Number of 1 Bits Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit integer ’11' has binary representation 00000000000000000000000000001011 , so the function should return 3.

Leetcode:Same Tree

Same Tree Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value.

Leetcode:Delete Node in a Linked List

Delete Node in a Linked List Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3 , the linked list should become 1 -> 2 -> 4 after calling your function.

Leetcode:Single Number

Single Number Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?

Leetcode:Maximum Depth of Binary Tree

Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.