I don't think Star Trek would work like that. Its just not in the story's nature to KILL the entire crew of the Yorktown.
Are you referring to TVH or TOS? Because if you're referring to TOS, remember the Excalibur or the Intrepid? Both ships were completely wiped out, with the Excalibur left adrift. I'm sure Starfleet had to consider repairing her though, despite loss of all hands (Intrepid was destroyed if I recall correctly)