מדעי המחשב, קיץ תשפ"ב, מס' 899381 בגרות במדעי המחש...

מדעי המחשב, קיץ תשפ"ב, מס' 899381 בגרות במדעי המחשב פתרון מלא

public static boolean isIncluded(Node<Integer> lst1, Node<Range> lst2)
{
while(lst1 != null && lst2!=null)
{
if(lst1.getValue() >= lst2.getValue().getLow() && lst1.getValue()<=lst2.getValue().getHigh() )
{
lst1 = lst1.getNext();
}
else
{
lst2 = lst2.getNext();
}


}
if(lst1 == null)
return true;

return false;
}