Java Zigzag Decode zigzagDecode(int encoded)

Here you can find the source of zigzagDecode(int encoded)

Description

zigzag Decode

License

Open Source License

Declaration

public static int zigzagDecode(int encoded) 

Method Source Code

//package com.java2s;

public class Main {
    public static int zigzagDecode(int encoded) {
        return (encoded >>> 1) ^ (-(encoded & 1));
    }/*from  w  w w  .  j av  a  2s  . co m*/

    public static long zigzagDecode(long encoded) {
        return (encoded >>> 1) ^ (-(encoded & 1));
    }
}

Related

  1. zigzagDecode(int encoded)
  2. zigZagDecode(int i)
  3. zigzagDecode(int[] src)
  4. zigZagDecode(long n)