随笔分类 - 算法与数据结构
摘要:顺序表 #ifndef SEQLIST_H #define SEQLIST_H //顺序存储 typedef int DataType; struct Node { int MaxNum; //顺序表表中最大存储元素个数 int num; DataType *element; }; typedef
阅读全文
摘要:#pragma once #ifndef _LINKSTACK_ #define _LINKSTACK_ #include<iostream> using namespace std; typedef int DataType; //链栈结构信息 struct node { DataType inf
阅读全文
摘要:public class BinaryTree { // 二叉树 根节点 public TreeNode rootNode = null; // 构造函数 创建问二叉树 public BinaryTree(int[] data) { for (int i = 0; i < data.length;
阅读全文
摘要:public class Quick { public static void main(String[] args) { //Comparable[] a = {'E', 'E', 'G', 'M', 'R', 'A', 'C', 'E', 'R', 'T'}; Comparable[] a =
阅读全文
摘要:public class Merge { public static void main(String[] args) { Comparable [] a = {'E','E','G','M','R','A','C','E','R','T'}; sort(a); for (Comparable i
阅读全文
摘要:#pragma once #ifndef _SEQSTACK_ #define _SEQSTACK_ #include <iostream> using namespace std; typedef int DataType; struct SeqStack { int MAXNUM; int t;
阅读全文
摘要:1. 转置链表 问题描述:输入一个链表,反转链表后,输出新链表的表头。 示例: 输入 {1,2,3} 输出 {3,2,1} public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = va
阅读全文