![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
孙艳强
物竞天择,适者生存。
展开
-
DES加密算法
DES加密算法public class SymmetricalEncryptionDemo {public static void main(String[] args) throws Exception { //要加密的内容 String content = "今晚6点 505 嘿嘿嘿!"; byte[] bytes = content.getBytes(); //原创 2017-03-08 14:01:01 · 277 阅读 · 0 评论 -
RSA非对称加密
RSA非对称加密public class AsymmetricEncryptionDemo01 {public static void main(String[] args) throws Exception { String content = "也不会反对呀发神经的沙发上的快感"; //非对称加密用公钥加密 KeyPairGenerator pairGenerator =原创 2017-03-08 14:04:16 · 383 阅读 · 0 评论 -
二叉树排序
二叉树排序代码实现(重复数据无法插入)public class MyTree {Node root;//根节点class Node{ Node left;//左儿子 Node right;//右儿子 Node parent;//父节点 Object data;//数据 public Node(Object data) { super();原创 2017-03-08 14:05:33 · 252 阅读 · 0 评论 -
交换2变量的值
交换2变量的值四种方法方法1,定义一个中间变量. int temp = a;//temp=12 a = b;//a = 10 b = temp;//b=12方法2,使用加减法 a = a + b;//a = 22,b=10 b = a - b;//a = 22;b=12方法3,使用乘除法,除数不能为零 a = a*b; //a = 120,b=10原创 2017-03-08 14:07:15 · 220 阅读 · 0 评论 -
快速排序
/* 快速排序 * @param datas * @param left * 快速排序的起始位置 * @param right * 快速排序的终止位置 * @author sunyanqiang */public static void qiuckSort(int[] datas,int left,int right){ if (left < right)原创 2017-03-08 14:06:44 · 188 阅读 · 0 评论 -
带括号的四则运算
带括号的四则运算public class CaculatorDemo {public static void main(String[] args) { String exp = "-3+6*-2-8/-4*2";//-11 String exp2 = "-3+(9+8+(8-4)/2)*2";//35 //double result = calc(exp); dou原创 2017-03-08 14:05:02 · 2066 阅读 · 0 评论 -
MD5加密
public class MesssageDigestDemo {public static void main(String[] args) throws Exception { String content = "大叔大婶辜负撒回"; //获取消息摘要的单例对象 MessageDigest digest = MessageDigest.getInstance("MD5")原创 2017-03-08 14:03:04 · 247 阅读 · 0 评论 -
java和js实现aes加密解密
原文地址:http://blog.csdn.net/z83986976/article/details/51027150java代码package cn.easier.utils;import javax.crypto.Cipher;import javax.crypto.KeyGenerator;import javax.crypto.spec.SecretKey转载 2017-08-28 17:57:09 · 2190 阅读 · 0 评论