Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 858 Bytes

README.md

File metadata and controls

25 lines (22 loc) · 858 Bytes

reversing_number

Reverse the number by different approach

Old approach:

Modulo and integer divide to get the number

Advantage:

  • Simple, arithmetic operation required

Disadvantage:

  • Dealing with long number seems to be very hard to achieve

New approach:

Using built-in function:

Convert number to string and use built-in function to reverse the string then return

Advantage:

  • Dealing with big number is a piece of cake

Disadvantage:

  • Some programming language doesn't have built-in reverse string function
  • Require some simple knowledge when dealing with string

Handmade reverse function:

Instead of using built-in function, we implement our own reverse function

Advantage:

  • Like using built-in function

Disadvantage:

  • Dealing string in some low-level programming language may require strong basic CS knowledge