// void main() { //Create an instance of the class Calculate a=Calculate(); print("Recursion of factorial:"+ a.factorial(4).toString()); print("Linear Search:"+ a.linearSearch([2,11,5,32,6,23],5)); } // output Result:24 Result:5 // Create Calculate class class Calculate with LinearSearch { factorial(int n){ if(n==0 || n==1){ return 1; }else{ return n*factorial(n-1); } } } //Create Linear search method using mixin class mixin LinearSearch { // Linear search method linearSearch(List<int>? list,int x){ int i=0; for( i; i<list!.length; i++){ if(list[i]==x){ print(list[i].toString()); } }} }
EasyLearningTechHub is a smart learning platform created to make technology simple, practical, and accessible for everyone. 🚀 We focus on teaching in an easy, step-by-step way so learners can understand concepts clearly, even if they are beginners. Our content covers programming, mobile app development, software tools, and the latest tech trends with real-world examples and hands-on guidance. Our mission is to empower learners to grow, innovate, and achieve faster with EasyLearningTechHub. 🌟