Hi @natasha0412, thanks for writing!
First, diminished scale is not directly related to melodic minor, or in a matter a fact to any other scale either (of course deep down EVERYTHING in harmony is connected).
You could think the diminished scale as a connective piece and a foundation to all that works as a tension, in other words dominant (or 25).
I would not think of half/whole, whole/half scales as a different thing, in the end there are only 3 different diminished scale; one starting from the not C, one from Db and one from D (after D there would be Eb which of course is the same as the scale starting form C etc.)
So, the important thing is to understand the connection to the dominant chord and to the 25.
For example, let’s take C dim chord:

If you look at these notes, you realize they actually create F7b9 chord:

One way to think about the rest of the notes in the C diminished scale is to consider them as chromatic approach notes to the actual dim chord; B to C, D to Eb, F to Gb and Ab to A.
Another way is to think of it as the 2 chord of the 25, which of course is C-7.
Now if you look again, the C diminished scale start with 4 notes of Cminor scale:

continuing with 4 notes from the minor scale tritone away (remember, tritone is connecting things in many level, being the building block of diminished), in this case Gb (or F#) minor

This is how the 2 chord of the 25 (C-7 F7) can help understand the dim scale.
Like I mentioned earlier, there is no use of making things more complicated by thinking diminished scale as 2 different things (half/whole whole/half) when it actually is just one thing, and we can ALWAYS trace the function of any diminished scale/chord to a dominant, and to a 25.
I hope this helped, please let me know if you have any further questions!
-Tuomo