算法第四版练习题答案

原文: https://www.ifee.win/blog/2021/05/09/%e7%ae%97%e6%b3%95%e7%ac%ac4%e7%89%88%e7%bb%83%e4%b9%a0%e9%a2%98%e7%ad%94%e6%a1%88/

算法第4版练习题答案

Algorithms 4th edition exercise answers.

 
1FUNDAMENTALS
1.2.13Transaction.javatransaction data type
1.2.16Rational.javarational number data type
1.2.19Date.javadate data type
1.3.1FixedCapacityStackOfStrings.javaadd isFull() method to stack
1.3.4Parentheses.javabalanced parentheses
1.3.7Stack.javaadd peek() method to stack
1.3.10InfixToPostfix.javainfix-to-postfix conversion
1.3.11EvaluatePostfix.javaevaluate a postfix expression
1.3.14ResizingArrayQueue.javaresizing array queue
1.3.37Josephus.javaJosephus problem
1.4.14FourSum.javabrute-force 4-sum
1.5.7QuickUnionUF.javaquick union
1.5.7QuickFindUF.javaquick find
1.5.17ErdosRenyi.javaErdos-Renyi simulation
2SORTING
2.1.1TraceSelection.javatrace of selection sort
2.1.4TraceInsertion.javatrace of insertion sort
2.1.9TraceShell.javatrace of shellsort
2.1.21Transaction.javaadd natural order to Transaction
2.1.22SortTransactions.javasort transactions
2.1.23InsertionX.javainsertion sort with sentinel
2.1.24InsertionX.javainsertion sort with half exchanges
2.2.2TraceMerge.javamergesort trace
2.2.3TraceMergeBU.javabottom-up mergesort trace
2.2.9Merge.javamergesort without static array
2.2.11MergeX.javaimproved mergesort
2.2.19Inversions.javacount number of inversions
2.2.20Merge.javaindex sort
2.3.1TracePartition.javapartition trace
2.3.2TraceQuick.javaquicksort trace
2.3.5Sort2distinct.javasort array with 2 distinct keys
2.3.12TraceQuick3way.java3-way quicksort trace
2.3.16QuickBest.javabest-case for quicksort
2.3.22QuickX.javaBentley-McIlroy 3-way quicksort
2.4.3OrderedArrayMaxPQ.javaordered array priority queue
2.4.3UnorderedArrayMaxPQ.javaunordered array priority queue
2.4.15MaxPQ.javacheck if an array is heap-ordered
2.4.25CubeSum.javafind a^3 + b^3 = c^3 + d^3
2.4.33IndexMaxPQ.javaindex priority queue
2.5.8Frequency.javacount word frequencies
2.5.12SPT.javashortest processing time first rule
2.5.13LPT.javalongest processing time first rule
2.5.14Domain.javasort by reverse domain name
2.5.16California.java2003 California gubernatorial election order
2.5.19KendallTau.javaKendall Tau distance
2.5.24StableMinPQ.javastable priority queue
2.5.25Point2D.javapoint comparators
2.5.27Insertion.javaindex sort
2.5.28FileSorter.javasort files by name
3SEARCHING
3.1.1GPA.javacompute GPA
3.1.2ArrayST.javaunordered-array symbol table
3.1.5SequentialSearchST.javaadd size(), delete(), and keys()
3.1.16BinarySearchST.javaadd delete()
3.1.17BinarySearchST.javaadd floor()
3.1.29TestBinarySearchST.javatest client
3.1.30BinarySearchST.javacheck internal invariants
3.2.6BST.javaadd height() method
3.2.10TestBST.javatest client
3.2.13NonrecursiveBST.javanonrecursive BST
3.2.24PerfectBalance.javaperfectly balanced BST
3.2.32BST.javaorder check
3.2.33BST.javarank/select check
4GRAPHS
4.1.3Graph.javaadd copy constructor
4.1.13BreadthFirstPaths.javaadd distTo() method
4.1.23BaconHistogram.javahistogram of Bacon numbers
4.1.26DegreesOfSeparationDFS.javadegrees of separation with DFS
4.1.27MemoryOfGraph.javamemory of Graph data type
4.1.36Bridge.javafind bridges
4.2.3Digraph.javaadd copy constructor
4.2.21MemoryOfDigraph.javamemory of Digraph data type
4.2.23DirectedEulerianCycle.javadirected Eulerian cycle
4.2.31TopologicalQueue.javaqueue-based topologial sort
4.2.39WebCrawler.javaweb crawler
4.3.9EdgeWeightedGraph.javaedge-weighted graph constructor
4.3.11MemoryOfEdgeWeightedGraph.javamemory of edge-weighted graph
4.3.17EdgeWeightedGraph.javaadd toString() to EdgeWeightedGraph
4.3.21PrimMST.javaadd edges() to PrimMST
4.3.22PrimMST.javaminimum spanning forrest
4.3.22KruskalMST.javaminimum spanning forrest
4.3.33KruskalMST.javaMST certification
4.3.43BoruvkaMST.javaBoruvka's algorithm
4.4.2EdgeWeightedDigraph.javaadd toString() method
4.4.11MemoryOfEdgeWeightedDigraph.javamemory of EdgeWeightedDigraph data type
4.4.12Topological.javatopological sort in edge-weighted digraphs
4.4.12EdgeWeightedDirectedCycle.javadirected cycle in edge-weighted digraphs
4.4.28AcyclicLP.javalongest paths in DAGs
4.4.35LazyDijkstraSP.javalazy implementation of Dijkstra

 
  • 4
    点赞
  • 61
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值