![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
yeleits
……
展开
-
递归与非递归的二叉树遍历
import java.util.ArrayList; import java.util.List; import java.util.Stack; import org.junit.Test; public class BinaryTreeTraverse { class TreeNode { int val; TreeNode left; TreeNode right; public TreeNode(int val) .原创 2021-01-12 00:56:39 · 82 阅读 · 1 评论 -
二叉搜索树
import java.util.ArrayList; import java.util.List; public class BinarySearchTree<Key extends Comparable<Key>, Value> { Node<Key, Value> root; Node get(Node node, Key k) { if (node == null) { return null; .原创 2021-01-12 00:11:21 · 60 阅读 · 0 评论 -
排序算法
import org.junit.Test; import java.util.Random; /** * 从小到大的排序算法 */ public class SortMain { private void swap(int[] arr, int i, int j) { int temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } private static int lengt.原创 2021-01-09 15:59:41 · 60 阅读 · 1 评论