Most Linux distributions, including RedHat, don't have such a thing as "the whole directory where the software is located". Instead, according to the FHS protocol under Linux, the software configuration files are placed in the /etc directory, the executable programs are placed in the bin and sbin directories, the dynamic link libraries are placed in the lib directory, and other resources such as manuals and icons are placed in the /usr/share. I don't know how you "deleted the whole directory where the software is located".
Rpm, deb and other software package management systems will maintain a binary database for the installed software packages to ensure the speed of related queries. After manually deleting files, the database has not been modified, and the result of rpm quick query is of course that the software has not been uninstalled.