Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.

Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.

Pictures about edge detection:

mainly use PIL to handle pictures, use filter to filter edges, then add the edges and the original pictures together

Use the sumup of all the number subtract the sum of them.

1 | int missingNumber(int* nums, int numsSize) { |

This is not a difficult one.

Basic idea is, assum that we have a self-sorted queue. Everytime, we choose the smallest one *n*, insert 2*n , 3*n , 5*n into this queue. After n times, we will get the n-th Ugly number.

The time will be $O(nlogn)$. Do we have a better way? The answer is YES!

I’m so tierd and upset today. I want to practise a DFS, BFS and a recursive.

I find it’s easy for me to write a BFS or DFS. So I just wrote a Hanoi tower.

It’s a very basic algorithm. This is my code.

It’s a program about basic insertion and deletion of a heap.(include heapify)

It’s insertion and deletion time complexity is $O(logn)$

Once I finished this code and began to run, it runs without bug.

Which means I finished this code Without any debuging~

I spent half an hour to write this program

This is a *small top* heap