Another way to look at it is if the states are within a small distance of each other. Using PostGIS, you can do this rather easily:

    SELECT 
      s1.name state1, 
      s2.name state2,
      CASE WHEN ST_DWithin(s1.the_geom::geography,s2.the_geom::geography,500) THEN true ELSE false END share_border
    FROM state_polygons s1, states_polygons s2
    WHERE s1.name != s2.name AND s2.name < s1.name
    ORDER BY share_border DESC, state1 ASC

I have a data table of states in my CartoDB account and ran that query. Depending on the data, you can choose a more accurate number than 500 meters as I did here.

This produces a data table like this:
![screen cap of postgis query][1]


  [1]: https://i.sstatic.net/Mxu4s.png