Skip to main content
added 61 characters in body
Source Link
vnp
  • 58.7k
  • 4
  • 55
  • 144
  • The two-argument overload void splice(DLNode lft, DLNode rgt) is never called. push_front and pop_back are never called either. If you write a method, at least write a unit test for it.

  • I am not sure I understand what do you mean by scattered. Both tests fill the (same) list with the random numbers, don't they?

  • The verify sort worked loop deserves a name. Consider making an is_sorted method.

    That said, the first (sequential) sort is not verified.

  • sortr base case doesn't feel right. If sz == 1, the np.end must be equal to np.beg.next; if it doesn't, something went awfully wrong. Use an assertion perhaps, and terminate if it failed, but don't blindly reassign np.end.

  • I do not endorse use of tla. Please spell left, right, begin, next, etc.

  • The two-argument overload void splice(DLNode lft, DLNode rgt) is never called. push_front and pop_back are never called either. If you write a method, at least write a unit test for it.

  • I am not sure I understand what do you mean by scattered. Both tests fill the (same) list with the random numbers, don't they?

  • The verify sort worked loop deserves a name. Consider making an is_sorted method.

  • sortr base case doesn't feel right. If sz == 1, the np.end must be equal to np.beg.next; if it doesn't, something went awfully wrong. Use an assertion perhaps, and terminate if it failed, but don't blindly reassign np.end.

  • I do not endorse use of tla. Please spell left, right, begin, next, etc.

  • The two-argument overload void splice(DLNode lft, DLNode rgt) is never called. push_front and pop_back are never called either. If you write a method, at least write a unit test for it.

  • I am not sure I understand what do you mean by scattered. Both tests fill the (same) list with the random numbers, don't they?

  • The verify sort worked loop deserves a name. Consider making an is_sorted method.

    That said, the first (sequential) sort is not verified.

  • sortr base case doesn't feel right. If sz == 1, the np.end must be equal to np.beg.next; if it doesn't, something went awfully wrong. Use an assertion perhaps, and terminate if it failed, but don't blindly reassign np.end.

  • I do not endorse use of tla. Please spell left, right, begin, next, etc.

Source Link
vnp
  • 58.7k
  • 4
  • 55
  • 144

  • The two-argument overload void splice(DLNode lft, DLNode rgt) is never called. push_front and pop_back are never called either. If you write a method, at least write a unit test for it.

  • I am not sure I understand what do you mean by scattered. Both tests fill the (same) list with the random numbers, don't they?

  • The verify sort worked loop deserves a name. Consider making an is_sorted method.

  • sortr base case doesn't feel right. If sz == 1, the np.end must be equal to np.beg.next; if it doesn't, something went awfully wrong. Use an assertion perhaps, and terminate if it failed, but don't blindly reassign np.end.

  • I do not endorse use of tla. Please spell left, right, begin, next, etc.