Polymorphism is not inherently dependent on inheritance.
Polymorphism is a rather abstract concept about giving uniformous interfaces to different kinds of values.
In common object-oriented languages like Java or C#, these interfaces are provided through class inheritance, but this is one possible implementation of polymorphism and not the concept of polymorphism in general.
Duck typing, structural typing, C++-style templates or typeclasses all provide other implementations of polymorphism.
Just see all this polymorphous codes in order to provide an interface to ducks ...
Inheritance/Interfaces (C#):
interface Duck { void quak(); }
void DoQuak(Duck d) { d.quak(); }
Dynamic Duck-typing (Python):
def DoQuak(d):
d.quak();
Templates (Static duck-tying) (C++):
template <typename T>
void DoQuak(const T& d) { d.quak(); }
Structural types (Scala):
def DoQuak(d : { def quak() : Unit }) { d.quak() }
Type classes (Haskell):
class Quakable a where
quak :: a -> IO ()
doQuak d = quak d