Author Archives: riveridea

Invert binary tree – iterative method

This problem is famous due to the wellknown twett, by Max Howell. I can not say it is hard or easy. Here just provide the iterative method as recursive method is really too easy. In general,  you just need to swap … Continue reading

Posted in Algorithms, Tech | Leave a comment

Iterative Method to check if the Binary Search Tree is valid

Problem Description: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node’s key. The … Continue reading

Posted in Algorithms | Leave a comment

Core algorithm in real projects

http://cstheory.stackexchange.com/questions/19759/core-algorithms-deployed/19773#19773

Posted in Algorithms | Leave a comment

Matlab code to generate 1023 PN sequence.

I am using this code to generate a PN sequence with 1023 length. h = commsrc.pn(‘GenPoly’, [[10 7 0]], ‘Mask’, [0 0 0 0 0 0 0 0 0 1]); set(h, ‘NumBitsOut’, 1023); pn = generate(h); len = length(pn); for … Continue reading

Posted in Draft | Leave a comment

Set remote display on Ubuntu

On Server: 1. go to /etc/lighdm, in lightdm.conf add [SeatDefaults] xserver-allow-tcp=true 2. on terminal: xhost + On Client: 1. export DISPLAY=$IP_ADDR_SERVER:0.0

Posted in Draft | Leave a comment

Upgrade Ubuntu to new release

sudo vi /etc/update-manager/release-upgradesto set the prompt=normal or lts. then sudo do-release-upgrade, sometime you need -d

Posted in Draft | Leave a comment

Compressive Sensing Resources

https://www.cgran.org/wiki/CompSens  http://dsp.rice.edu/cs

Posted in Draft | Leave a comment