Leaving out endings to sentences


A lot of times, endings to sentences are omitted for some reason. For example,
"konna ni ooki na tatemono no naka ni ita to wa" may be completed by something
like "omowanakatta". I can't fully remember other ones but there are times
sentences end in "wo" that would be completed by ending something like
"inorimasu" or "[...]te kudasai". I know the endings should be obvious in most
cases but is this kind of a thing more formal speech or casual speech, and is
it more common in speech than in written Japanese? Is there a linguistic term
for this?

