One of your two computers needs to have two networking connections. If you have one machine with Ethernet and WiFi and a second machine with only WiFi, then you would connect the cable to the first machine and then create an AdHoc WiFi network between the two machines and then, assuming Windows, you would create a shared internet connection between the Ethernet and WiFi on the first machine. This is called Internet Connection Sharing or ICS, which should help you search for it.
If you have two Ethernet ports on the first machine and one Ethernet port on the second machine, then you can also do this but you do need an extra piece of equipment: a crossover Ethernet cable. This kind of cable reverses some of the wires inside so that two PC Ethernet ports can talk to each other (under normal cables, PC Ethernet ports can only talk to Router/Switch/Hub Ethernet ports). If you can't find a crossover cable then you can also use two normal cables if you plug them both into an Ethernet switch or hub (hubs are typically slower). You'll also notice that almost all routers have Ethernet ports since they contain a switch; a switch itself is cheaper than a router but not as cheap as a cable, obviously.
If your first machine has Ethernet + WiFi and your second machine has Ethernet only then you can't make these work. You'd need to add a WiFi connection to the second machine or add an Ethernet connection to the first machine and that means a USB dongle (for laptops or desktops) or possibly a PCI/PCI-Express card for desktops.
If both machines have only one connection then you get to choose one to add a connection to.
Also worth mentioning that if you do this it means that for the second machine to have any access you also need the first machine to be on. And ICS isn't unique to Windows -- you can do the same thing in Linux and OS X it's just called something different.
For your idea about an "Ethernet splitter" - this can't work. To understand how they work you first need to know that an Ethernet cable is typically connected to an 8 wire cable but it only uses 4 pins (wires). This means you can, in principle, run two connections down the one cable. You need to recognize that the other end of the Ethernet port you're seeing goes to some router/switch somewhere in the building and it goes into one port on that switch, not two. Hence your port is only capable of connecting one device even though there are extra wires there, in the wall shared within that cable, for a second one. *IF* you had control of the back end, then you could use two Ethernet splitters to merge two Ethernet ports onto that one cable and then split the port that you see into two and both would work. That would be because the one port has two connections into the switch. I'm also saying this like I know for sure that they don't do that, but in reality it's just overwhelmingly likely that they don't do that because if you do that then you need twice as many routers/switches which is a silly expense when hardly anyone would ever try to do that and therefore you'd always have under 50% utilization.
Really, if you can find a switch for a good price that's your best bet. The thing is you said "hostel" which makes me think Europe and I'm well aware of how European tech stores work and the prices you're likely seeing (though maybe it's just what I got used to in Switzerland). Odds are a switch is either impossible to find because routers are so popular or that it's almost as expensive as a router to start with.