数据结构
weixin_37751422
这个作者很懒,什么都没留下…
展开
-
通过先序遍历,求中序遍历和后序遍历
package com.com.liutong;import java.util.Scanner;class TreeNode { public char data; public TreeNode leftChild; public TreeNode rightChild;} class BinaryTree { int i = 0; public TreeNode createBinaryTree(String arr){ if原创 2022-05-30 11:16:29 · 215 阅读 · 0 评论 -
巧用夹角计算8皇后问题
package com.com.liutong;public class Queen { public int row=7; public int col=7; public int [][] list =new int[8][8]; public int total=0; public void fz(){ for(int i=0;i<this.row;i++) for(int j=0;j<this.col;j原创 2022-05-27 18:55:40 · 87 阅读 · 0 评论 -
java 链表 快慢指针求中间节点
快慢指针 求中间节点package com.link;import java.awt.print.Printable;import java.util.ArrayList;import java.util.List;public class Solution { /** * @param head: the given linked list * @return: the array that store the values in reverse order原创 2021-03-04 12:06:30 · 153 阅读 · 1 评论 -
单链表翻转 非递归方法 返回数组
单链表翻转 非递归方法返回数组package com.link;import java.util.ArrayList;import java.util.List;public class Solution { List<Integer> list =new ArrayList<>(); public List<Integer> reverseStore(ListNode head) { // write your c原创 2021-03-04 11:19:44 · 73 阅读 · 1 评论