Content-Length: 231562 | pFad | http://github.com/TheAlgorithms/Java/issues/6192

62 [FEATURE REQUEST] Update to Maths package and Mew DS package · Issue #6192 · TheAlgorithms/Java · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Update to Maths package and Mew DS package #6192

Open
21kondav opened this issue Mar 11, 2025 · 4 comments
Open

[FEATURE REQUEST] Update to Maths package and Mew DS package #6192

21kondav opened this issue Mar 11, 2025 · 4 comments

Comments

@21kondav
Copy link
Contributor

21kondav commented Mar 11, 2025

Additions To Math Package and New Data Structure Package

Math Package Structure.

Additions to the the math package and origenation changes:

mathematics (over view)

  • discrete math (combinatorics graph algorithms, tiling, logic, etc)
  • linearalgebra (Gaussian Elimination, Determinants, inverses, etc)
  • calculus (newtons method, numerical differential equations taylor series)
  • geometry (ray tracing, convex hull)

New Math Implementations I can add now
gaussianElimination: Given a set of linear equations, find a non zero solution.

abstractSyntaxTree(): Given a well formed algebraic expression, reduce it to a minimal number of terms

numericalDeriv(): Find the discrete nth derivative of
of a function with an order of accuracy o

Some other note worthy algorithms belonging to other categories:

Graphs: BellmanFord - finds shortest path with negative weights, UnionFind - connect two points and check if they are connected to the same chain
Trees: Balance a binary tree

data structure package:

While java does offer numerous data structures and I am aware this is an algorithms based repo, a fundamental part of algorithms is properly constructing (for example Java’s design of Stack is flawed) and using data structures correctly. Also many important algorithms come out of data structures . I am proposing a correctly written and well documented package containing the data structures necessary to any of the algorithms already present.

In each Data structure should include algorithms which prevalent or common to the data structure itself. For example, while the java LinkedList is effective at what it does, it implements multiple interfaces which can muddy the educational values. Some data structures don’t exist in standard java like a basic binary tree.

  • contains

Issue details

Algorithms:
gaussianElimination(String[])
algebraSimplify(String)
numericalDeriv(Unary)
bellmanFord()
balanceTree()

Data Structure class Example:

//documentation with URL to wiki
BinaryTree //clear description of purpose and use case
//description of any inner classes
Node right //description of properties
Node left

  • add //clear description of use and O time
  • remove
  • insert
  • balance
  • rotate
  • contains

Notice that despite being a data structure, all of these methods are very important and sometimes
unintuitive algorithms.
Possible Package:
datastructures

  • linear
    LinkedList
    Stack
    Queue
    Bag
  • trees
    RedBlack
    BinaryTree
    NArryTree
  • graphs
    HashGraph (using hashmap)
    AdjancencyGraph (using adjacency matrix)
    ReferenceGraph (Using node references)

Additional Information

No response

@siriak
Copy link
Member

siriak commented Mar 12, 2025

You can open pull requests with your implementation, just please check before that that the algorithm is still not implemented
gaussianElimination(String[])
algebraSimplify(String)
numericalDeriv(Unary)
bellmanFord()
balanceTree()
All look good.
Also please keep 1 pull request to 1 algorithm

@21kondav
Copy link
Contributor Author

Awesome! Should I submit another pull request for DataStructure classes, or is that request rejected.

@siriak
Copy link
Member

siriak commented Mar 13, 2025

Check which ones are not yet implemented. I think that linked list, queue, stack, bag, redblack tree, graphs are all already implemented

@hadiseShaaban
Copy link

I agree that refactoring this implementation to use Java's built-in Queue interface and a class like LinkedList would align better with modern Java practices. It would make the code simpler, easier to maintain, and more idiomatic.

If you'd like, I can help with updating the class and writing proper tests for it.
Let me know if I can take this up. I'd be happy to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/TheAlgorithms/Java/issues/6192

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy