mmnaseri / cs-review Goto Github PK
View Code? Open in Web Editor NEWAn effort to refresh my CS background
License: MIT License
An effort to refresh my CS background
License: MIT License
ArrayHeap can also be tested with equal items as an edge case.
The algorithm described by the book does not return the minimum tree. This is demonstrated by the book on page 633 of the ebook where the result has a total weight of 37, while running the Prim algorithm from the book returns a total of 35, as seen on page 635.
Figure out why this behavior is not considered as invalid.
We should have a facility that would monitor data structures and their respective states and reports back a failure on their part to abide by the intrinsic properties
ArrayMatrix should be tested
LinearSelector uses divide and conquer algorithm to split, partition and find the order. When the order is not the pivot index, we don't need to include it in the next sub problem.
Right now, controlling a feature requires extending the original class for the data structure which, while trivial, is tedious.
It would be far better if there was a facility for proxying data structures and setting feature-base expectations on the data structure so that we could arbitrarily secure any given data structure of choice for any given task.
One example would be:
final SearchTree<Integer, ? extends TreeNode<Integer>> tree;
tree = new BinarySearchTree<Integer, BinaryTreeNode<Integer>>();
final SearchTree<Integer, ? extends TreeNode<Integer>> securedTree;
securedTree = givenDataStructure(tree)
.observe(inOrderWalkYieldsSortedValues())
.observe(minimumIsOnTheLeftMostNode())
.observe(maximumIsOnTheRightMostNode())
.observe(nodeIsGreaterOrEqualToItsLeftChild())
.observe(nodeIsLessThanItsRightChild())
.observe(nodeIsGreaterOrEqualToItsLeftChild())
.secure();
At this point, if the tree is not honoring any of the features, we will see MonitorFailureException
s. Features will be checked before and after the execution of each operation, ensuring that the data structure is always in a valid state.
(We could probably monitor the data structure upon creation, and then after each operation, and it would suffice).
This should be theoretically implementable if features can be observed from the outside, which is not always the case. In such cases, a strategy is probably required and I should probably think of a way to incorporate that into the DSL.
Each of these should instead return a new graph that matches the original, and mark, color, or otherwise modify that graph.
I have seen invalid colorings that break the red black property on the red black tree class.
The private delete method runs over few hundres of lines of code. Can this be more modular?
https://github.com/mmnaseri/cs-review/blob/master/cs-clrs/src/main/java/com/mmnaseri/cs/clrs/ch18/s3/BTree.java#L31
LevelLinkedTreeNodeTest should be implemented.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.