Actually I had the 12-24mm. It was sharp as a razor at 24mm but not so much at 12mm. Somewhere the optics of wide angles are the opposite of telephotos. A 400mm zoom lens will never be as sharp as it is at 300mm. For wide angles a 10mm will never be as sharp as it is at 24mm. To my eyes in the flower picture, your 10-24 is beating the 35mm 1.8 in resolution (check the leaf and flower petals). The tree shot appears to be a focus-miss or bad camera setting or camera shake. If you can replicate the result you will know for sure.
Here are a couple of things you can do:
1. Mount your camera on a tripod and start shooting at multiple focal lengths say 10mm, 14mm, 18mm and 24mm. Keep the aperture at around f13. Check the results at 100% on your pc (make sure you compare both center and corners (corners will be softer) of the image. Best to do this with a resolution chart (link below)
- Now check the extremes of both 10mm and 24mm at varying apertures. You might find a sweet spot for your lens at which it is sharp for both the focal lengths. Depth of field is equally important for wide angles as it is for telephotos.
If you still think you have a bad lens or bad autofocus, you can try the following:
Download a back focus chart (DSC Labs | Resolution and Focus Charts) and print it large. Test your autofocus system according to the procedure mentioned here https://photographylife.com/how-to-quickly-test-your-dslr-for-autofocus-issues. Now be sure to do this test with multiple lenses not just one lens.