摘要:@Override public int TreeDeep(TreeNode treeNode) { if (treeNode == null) { return 0; } int ld = TreeDeep(treeNode.leftchild); int rd = TreeDeep(treeNo
阅读全文
摘要:/** * 前序遍历和中序遍历创建二叉树 Pre 前序遍历的数组 In 中序遍历的数组 lpre 前序遍历数组开始位置 hpre前序遍历结束位置 * lin前序遍历数组开始位置 hin前序遍历结束位置 */ @Override public TreeNode PreInCreat(int[] Pre
阅读全文
摘要:public TreeNode InPostCreat(int[] In, int[] Post, int lin, int hin, int lpost, int hpost) { TreeNode root = new TreeNode(0); if (Post.length == 0 || I
阅读全文
摘要:1 public int maxArea(int[] height) { 2 int left = 0, right = height.length - 1; 3 int maxArea = 0; 4 5 while (left < right) { 6 maxArea = Math.max(maxArea, Math.min(height[...
阅读全文
摘要:1 package com.wwj.cn; 2 3 public interface TreeInterf { 4 void PreOrderTraverse(TreeNode treeNode);// 前序遍历 递归 5 6 void InOrderTraverse(TreeNode treeNo
阅读全文
摘要:1 package com.wwj.cn; 2 3 public interface QueueInter { 4 5 void InitQueue(Queue queue);// 初始化队列 6 7 boolean EnQueue(Queue queue, SElemType e);// 队尾添加
阅读全文
摘要:1 package com.wwj.cn; 2 3 public class Queue { 4 private final int MAXSIZE = 10; 5 int[] data = new int[MAXSIZE]; 6 int front; 7 int rear; 8 }
阅读全文
摘要:1 package com.wwj.cn; 2 3 public interface SqStackInter { 4 boolean Push(SqStack sqStack, SElemType e);// 进栈操作 5 6 boolean Pop(SqStack sqStack, SElemT
阅读全文
摘要:package com.wwj.cn; public class SqStack { private final int MAXSIZE = 10; int[] data = new int[MAXSIZE]; int top;// 栈顶指针 }
阅读全文
摘要:1 package com.wwj.cn; 2 3 //定义树节点 4 public class TreeNode { 5 6 int val; 7 TreeNode leftchild; 8 TreeNode rightchild; 9 10 public TreeNode(int data) { 11 this.val ...
阅读全文
摘要:package com.wwj.cn; public class ListNode { int val; public ListNode next; ListNode(int x) { val = x; } }
阅读全文
摘要:题目概述 在车库中安排若干泊车机器人,根据给定的车位地图,合理优化机器人的数量及其运动路径,尽量减少客户在停车和取车中的等待时间,并使总成本最小。(试题用例包于5月初开放下载) 在车库中安排若干泊车机器人,根据给定的车位地图,合理优化机器人的数量及其运动路径,尽量减少客户在停车和取车中的等待时间,并
阅读全文