Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L lab02
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cs2-19wi
  • lab02
  • Issues
  • #2

Closed
Open
Created Dec 29, 2018 by Anirudh Mathukumilli@amathukuDeveloper

Spec 3 comments

This lab took me ~1 hour. The lab itself I think is pretty good. Here's my feedback.

  1. The Random.nextInt() function used to generate array lengths in the stress test can generate negative numbers. It should be surrounded with a Math.abs() to prevent that.
  2. The stress test often led to my computer running out of memory on the heap because Random.nextInt() can generate massive values for array lengths. I think we should use Random.nextInt() % 1000 or something like that.
  3. I had some issues with using linearSearch() as the ground truth value for binarySearch() when the randomly generated array in the stress test had duplicate values. For example, one of my randomly generated arrays had the needle value at both index 674 and 675. The linearSearch() found 674, while my binarySearch() found 675. I'm not sure how to address this, although I did find I could avoid duplicates if I used a sufficiently small array (i.e. Random.nextInt() % 900 was fine for the length).
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking