[perhaps fr Aleck Hoag, a thief whose fate was described in an 1844 book by George Wilkes]
The Dictionary of American Slang, Fourth Edition by Barbara Ann Kipfer, PhD. and Robert L. Chapman, Ph.D. Copyright (C) 2007 by HarperCollins Publishers. Cite This Source
Idioms and Phrases with smart alecky
An impudent or obnoxiously self-assertive individual, a wise guy, as in New teachers often have a hard time coping with the smart alecks in their classes. This expression, dating from the mid-1800s, probably alluded to a person of this description who was named Alec or Alexander, but his identity has been lost.