package Algorithm

Algorithm is a comprehensive package designed to provide a wide array of tools and techniques for solving complex computational problems. This package is an essential component for programmers, mathematicians, data scientists, and researchers who require efficient and reliable algorithms to analyze, process, and obtain solutions for various problems in diverse fields such as computer science, mathematics, and engineering. The package includes various algorithms for sorting, searching, graph theory, optimization, numerical analysis, and more, catering to a diverse range of applications and use-cases. The Algorithm package not only offers a vast selection of pre-built algorithms but also allows users to implement their custom algorithms or modify existing ones to suit specific needs. Users can easily leverage the package's extensive functionality and robust performance to tackle challenging tasks, ranging from simple sorting operations to advanced machine learning models. With clear documentation and a supportive user community, the Algorithm package is designed to boost productivity and streamline the development process, making it an invaluable resource for tackling complex computational tasks.
package org.gs

/** Algorithms for queues, priority queues, and index priority queues
  *
  * ==Queues==
  * {{{
  * val q = Queue('P', 'Q', 'E')
  * val headOfQ = q.head
  * val q1 = q enqueue 'Z'
  * }}}
  * ==Priority Queues==
  * {{{
  * val minPQ = new MinPQ(new ArrayBuffer[Char](20))
  * minPQ.insert(c))
  * val min = minPQ.pop
  * }}}
  * {{{
  * val maxPQ = new MaxPQ(new ArrayBuffer[Char](20))
  * maxPQ.insert(c))
  * val max = maxPQ.pop
  * }}}
  * ==Index Priority Queues==
  * {{{
  * val testSize = testStrings.size
  * val minPQ = new IndexMinPQ[String](testSize)
  * for {
  *   i <- 1 until testSize
  * } minPQ.insert(i, testStrings(i))
  * val minKeyIndex = minPQ.minIndex
  * val minKeyValue = minPQ.minKey
  * val sortedKeys = minPQ.keys
  * }}}
  * {{{
  * val testSize = testStrings.size
  * val maxPQ = new IndexMaxPQ[String](testSize)
  * for {
  *   i <- 1 until testSize
  * } maxPQ.insert(i, testStrings(i))
  * val maxKeyIndex = maxPQ.maxIndex
  * val minKeyValue = maxPQ.maxKey
  * val sortedKeys = maxPQ.keys
  * }}}
  * @see [[https://algs4.cs.princeton.edu/13stacks/]]
  * @see [[https://algs4.cs.princeton.edu/24pq/]]
  */
package object queue {}

LANGUAGE:

DARK MODE: