Start with the Apple Command Line Primer in the appendix of the shell scripting manual, and then work your way through the rest of the document. There's also a reasonable book around for what I think you're up to here—inferring from your username—which is learning C on a Unix system. That's the 21st Century C book by Klemens.
As for your question...
Those files are what was installed here.
Those files are what would be manually removed when removing nmap.
This after having used of the "package" installer.
There's no nmap removal tool for the package installer.
Which means manual removal.
Or you can choose to ignore the installed nmap, which is what I'd encourage doing here.
Why ignore nmap?
nmap uses negligible storage, and is only active when invoked.
Clobbering an incorrect file or directory somewhere under /usr/local might clobber something else.
if you do decide to (manually) delete the nmap files, have complete and current backups.
Once you know a little more about Unix and the command line and—again, inferring from your username—C programming on Unix systems such as macOS—then this nmap discussion and this removal might be worth revisiting, and the files and folders can then be deleted.