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

Processing byte array backwards #504

Merged
merged 1 commit into from
Jan 20, 2024
Merged

Conversation

C5H12O5
Copy link
Contributor

@C5H12O5 C5H12O5 commented Jan 20, 2024

Check List:

  • Tests pass (./test.sh <username> shows no differences between expected and actual outputs)
  • All formatting changes by the build are committed
  • Your launch script is named calculate_average_<username>.sh (make sure to match casing of your GH user name) and is executable
  • Output matches that of calculate_average_baseline.sh
  • For new entries, or after substantial changes: When implementing custom hash structures, please point to where you deal with hash collisions (line number)

Execution time:

  • 25.38s user 3.44s system 342% cpu 8.406 total << now
  • 45.87s user 2.82s system 530% cpu 9.185 total (last submission)
  • 182.35s user 4.36s system 99% cpu 3:06.76 total (reference implementation)

Notes:

  • add comments and improve code readability
  • processing byte array backwards
  • using bitwise operation to find specific byte (inspired by thomaswue)
  • deal with hash collisions: CalculateAverage_C5H12O5.java:245

@gunnarmorling
Copy link
Owner

00:07.680 now, nice.

@gunnarmorling gunnarmorling merged commit 8353a1c into gunnarmorling:main Jan 20, 2024
1 check passed
@C5H12O5 C5H12O5 deleted the xylitol branch January 22, 2024 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants