摘要:
实现的源码如下: import { Interface_Queue } from "../Interface_Queue"; import { DataStruct_BinaryMaxHeap } from "./DataStruct_BinaryMaxHeap"; /** * Autor: Cre 阅读全文
posted @ 2021-01-21 18:33
CYNLINQ
阅读(450)
评论(0)
推荐(0)
摘要:
源码如下: import { DataStruct_Array } from "../02-Arrays/DataStruct_Array"; //最大二叉堆也需要具有可比较性 type Comparable = { compareTo(that: Comparable): number; equa 阅读全文
posted @ 2021-01-21 18:32
CYNLINQ
阅读(322)
评论(0)
推荐(0)
摘要:
源码如下: import { DataStruct_LinkedList } from "../04-Linked-List/DataStruct_LinkedList"; import { Interface_Set } from "../Interface_Set"; /** * Autor: 阅读全文
posted @ 2021-01-21 18:29
CYNLINQ
阅读(203)
评论(0)
推荐(0)
摘要:
源码如下: import { Interface_Map } from "../Interface_Map"; class Node<K, V> { public key: K; //键 public value: V;//值 public next: Node<K, V>; public cons 阅读全文
posted @ 2021-01-21 18:27
CYNLINQ
阅读(194)
评论(0)
推荐(0)
摘要:
源码如下: import { DataStruct_BinarySearchTree } from "../06-Binary-Search-Tree/DataStruct_BinarySearchTree"; import { Interface_Set } from "../Interface_ 阅读全文
posted @ 2021-01-21 18:26
CYNLINQ
阅读(145)
评论(0)
推荐(0)
摘要:
实现Map类之前,需要先自实现Interface_Map<K, V>的接口,源码如下 export interface Interface_Map<K, V> { add(k: K, v: V): void; remove(k: K): V; contains(k: K): boolean; get 阅读全文
posted @ 2021-01-21 18:10
CYNLINQ
阅读(171)
评论(0)
推荐(0)
摘要:
二分搜索树也称二叉搜索树,它是一种树形的数据结构,如下图 它有如下性质: 1.所有的节点都比左子树中的节点大,如图中9和15 2.所有的节点都比右子树中的节点小,如图, 由于以上两条性质的成立,所以对一二叉树存在这样的性质: 二叉查找树的最小节点位于最顶端节点的最左边的子树行的末尾,例如图中3 二叉 阅读全文
posted @ 2021-01-21 17:26
CYNLINQ
阅读(439)
评论(0)
推荐(0)
摘要:
了解递归,掌握递归,对于学习更高级的数据结构是必须要的。什么是递归,递归的性质: 1.自己调用自己 2.存在结束条件 只有满足以上两点,这个递归才算是合法的递归,递归的代码: test1(x) { console.log(x);//没有结束条件,死递归 this.test1(x - 1); } te 阅读全文
posted @ 2021-01-21 17:11
CYNLINQ
阅读(314)
评论(0)
推荐(0)
摘要:
上几篇文章中,对于队列,链表的优化,都是出于数据结构的算法事件复杂度的优化考虑的,那什么是算法时间复杂度?通俗一点,就是你写的代码执行效率怎么样,如果执行效率很low,那你写的代码算法时间复杂度就很高,在计算算法时间复杂度时,有以下几种: O(1):比如直接输出console.log这种概念 O(n 阅读全文
posted @ 2021-01-21 15:58
CYNLINQ
阅读(311)
评论(0)
推荐(0)
摘要:
使用链表来实现队列,源码如下: import { Interface_Queue } from "../Interface_Queue"; class Node<T>{ public e: T; public next: Node<T>; public constructor(e: T, next: 阅读全文
posted @ 2021-01-21 15:54
CYNLINQ
阅读(191)
评论(0)
推荐(0)

浙公网安备 33010602011771号