algorithms
algorithms copied to clipboard
Algorithms & Data Structures in Go
### Problem The RSelect method is not returning the correct k-smallest element. Here is an example: ``` arr := []int{5, 2, 6, 8, 3, 1} x := RSelect(arr, 6, 0)...
I think this should be `if l.Len() == index {` https://github.com/arnauddri/algorithms/blob/master/data-structures/linked-list/linked_list.go#L82
There was a tiny problem with the condition. when the index is equal to the length of the list we must append it to the tail not when it's equal...
I checked your code, and I think that @arnauddri is right. I fixed this issue and actually added a new feature to it. I thought it might be good to...
Hi, I suggest implement resize in hash-table. Like this: [https://github.com/shady831213/algorithms/blob/master/hashMap/chainedHashMap/chainedHashMap.go](https://github.com/shady831213/algorithms/blob/master/hashMap/chainedHashMap/chainedHashMap.go) [https://github.com/shady831213/algorithms/blob/master/hashMap/chainedHashMap/chainedHashMap_test.go](https://github.com/shady831213/algorithms/blob/master/hashMap/chainedHashMap/chainedHashMap_test.go) :)
We implemented an API for resizing the hashtable in case of need. Clearly, the new capacity being greater than the current size of the hashtable is necessary to hold. There...
Here is our implementation of pre-order, in-order, and post-order traversal which returns nodes in a slice with the order we visit them in the desired traversing method.
it would be nice to have PreOrder, InOrder, and PostOrder traversal methods that return nodes in the desired order in an array or slice. I guess my friend and I...
https://github.com/arnauddri/algorithms/blob/736f5ebe59cfd72b778704fe9ba5e0ba25c775fe/data-structures/binary-tree/bst.go#L136 I think it should be ```go if parent.Left == h ``` `n` is never gonna equal to `parent.Left` right?, they don't have the same address. We only use `n`...
I looked into the code and actually, there is a tiny problem with it. There is an iteration in the Delete function which keeps traversing the tree until it finds...