X Tutup
The Wayback Machine - https://web.archive.org/web/20201211085337/https://github.com/TheAlgorithms/Go/pull/225
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

minimalistic radix sort implementation in go #225

Closed
wants to merge 6 commits into from

Conversation

@addy1997
Copy link

@addy1997 addy1997 commented Oct 16, 2020

Hello there,

I have implemented radix Sort(#4 ) in go. Have test-checked it, works fine.

@cclauss
Copy link
Member

@cclauss cclauss commented Oct 17, 2020

Please fix the failing tests.

addy1997 added 3 commits Oct 17, 2020
@addy1997
Copy link
Author

@addy1997 addy1997 commented Oct 17, 2020

@cclauss, tried fixing the error but the (Error: golangci-lint exit with code 3) persists. I think it's a bug. My code is running properly and I am having the output below. Have a look @c4llmeco4ch, @cclauss and @AndersonQ.

OUTPUT

Unsorted List: [10 2 303 4021 293 1 0 429 480 92 2999 14]
Running Radix Sort on Unsorted List
Sorting: 1's place [10 2 303 4021 293 1 0 429 480 92 2999 14]

Bucket:  [0 3 5 7 9 10 10 10 10 10]
Sorting: 10's place [10 0 480 4021 1 2 92 303 293 14 429 2999]

Bucket:  [0 4 6 8 8 8 8 8 8 9]
Sorting: 100's place [0 1 2 303 10 14 4021 429 480 92 293 2999]

Bucket:  [0 7 7 8 9 11 11 11 11 11]
Sorting: 1000's place [0 1 2 10 14 4021 92 293 303 429 480 2999]

Bucket:  [0 10 10 11 11 12 12 12 12 12]

Sorted List: [0 1 2 10 14 92 293 303 429 480 2999 4021]

@cclauss
Copy link
Member

@cclauss cclauss commented Oct 17, 2020

  Running [/home/runner/golangci-lint-1.31.0-linux-amd64/golangci-lint run --out-format=github-actions --path-prefix=sorts --issues-exit-code=0] in [/home/runner/work/Go/Go/sorts] ...
  level=warning msg="[runner] Can't run linter goanalysis_metalinter: S1037: failed prerequisites: [(inspect@TheAlgorithms/Go/sorts [TheAlgorithms/Go/sorts.test], isgenerated@TheAlgorithms/Go/sorts [TheAlgorithms/Go/sorts.test]): analysis skipped: errors in package: [/home/runner/work/Go/Go/sorts/radixSort.go:1:1: package main; expected sorts]]"
  level=warning msg="[runner] Can't run linter unused: buildir: analysis skipped: errors in package: [-: found packages sorts (bubblesort.go) and main (radixSort.go) in /home/runner/work/Go/Go/sorts]"
  level=error msg="Running error: buildir: analysis skipped: errors in package: [-: found packages sorts (bubblesort.go) and main (radixSort.go) in /home/runner/work/Go/Go/sorts]"

Is saying that bubblesort.go and radixSort.go are conflicting. Not a but in golangci-lint.

@addy1997
Copy link
Author

@addy1997 addy1997 commented Oct 17, 2020

  Running [/home/runner/golangci-lint-1.31.0-linux-amd64/golangci-lint run --out-format=github-actions --path-prefix=sorts --issues-exit-code=0] in [/home/runner/work/Go/Go/sorts] ...
  level=warning msg="[runner] Can't run linter goanalysis_metalinter: S1037: failed prerequisites: [(inspect@TheAlgorithms/Go/sorts [TheAlgorithms/Go/sorts.test], isgenerated@TheAlgorithms/Go/sorts [TheAlgorithms/Go/sorts.test]): analysis skipped: errors in package: [/home/runner/work/Go/Go/sorts/radixSort.go:1:1: package main; expected sorts]]"
  level=warning msg="[runner] Can't run linter unused: buildir: analysis skipped: errors in package: [-: found packages sorts (bubblesort.go) and main (radixSort.go) in /home/runner/work/Go/Go/sorts]"
  level=error msg="Running error: buildir: analysis skipped: errors in package: [-: found packages sorts (bubblesort.go) and main (radixSort.go) in /home/runner/work/Go/Go/sorts]"

Is saying that bubblesort.go and radixSort.go are conflicting. Not a but in golangci-lint.

So this is the problem with the native package, i.e., radixSort.
Please have a look at this fatih/vim-go#2700

addy1997 and others added 2 commits Oct 17, 2020
Co-authored-by: Christian Clauss <cclauss@me.com>
@addy1997
Copy link
Author

@addy1997 addy1997 commented Oct 17, 2020

@cclauss

I'm running into a limitation in my editor that I wonder if the golangci-lint project would be willing to help with while acknowledging it may be beyond your scope.

The summary is in my editor right now, I can either get compilation failures or errors from golangci-lint, not both. Would it be possible to have golangci-lint report compilation failures in the same format as it does for other linters, so that my editor can show them?

@cclauss
Copy link
Member

@cclauss cclauss commented Oct 17, 2020

They have ~150 open issues but you can try to add one more... https://github.com/golangci/golangci-lint/issues

@addy1997
Copy link
Author

@addy1997 addy1997 commented Oct 17, 2020

@cclauss Sir, can you commit it for the time being. Later, when the issue is resolved I will commit the changes. Also, my code works properly you can check it.

@addy1997
Copy link
Author

@addy1997 addy1997 commented Oct 17, 2020

@cclauss, Already the build of this repo is failing. My code was compiling and was the best among the contenders in terms of time complexity. Anyways, thanks for your help and guidance

@addy1997 addy1997 closed this Oct 17, 2020
@vedantmamgain
Copy link
Contributor

@vedantmamgain vedantmamgain commented Oct 19, 2020

Code has been copied from here

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

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.
X Tutup