The knapsack problem or rucksack problem is a problem in combinative or integrative optimization. In this kind of problem, there are set of items are given with a weight and a value, determine the number of each item included in a collection so that the total weight is less than or equal to the given limit and the total value Read more…


// CPP code for Dynamic Programming based // solution for 0-1 Knapsack problem #include // A utility function that returns maximum of two integers int max(int a, int b) { return (a > b) ? a : b; } // Prints the items which are put in a knapsack of capacity W void printknapSack(int W, int wt[], int val[], int Read more…


Genetic algorithm vs. Backtracking: N-Queen Problem – Towards Data Science One of the most famous problems solved by genetic algorithms is the n-queen problem. I implemented my genetic solver, plus the famous old backtracking. N Queen Problem | Backtracking-3 – GeeksforGeeks The N Queen is the problem of placing N chess queens on an N×N chessboard so that no two Read more…


// C++ program to print all combination // of size r in an array of size n #include using namespace std; void combinationUtil(int arr[], int data[], int start, int end, int index, int r); // The main function that prints // all combinations of size r // in arr[] of size n. This function // mainly uses combinationUtil() void printCombination(int Read more…


// C++ program to print all // permutations with duplicates allowed #include using namespace std; // Function to print permutations of string // This function takes three parameters: // 1. String // 2. Starting index of the string // 3. Ending index of the string. void permute(string a, int l, int r) { // Base case if (l == r) Read more…


// C++ program to demonstrate default behaviour of // sort() in STL. #include using namespace std; int main() { int arr[] = {1, 5, 8, 9, 6, 7, 3, 4, 2, 0}; int n = sizeof(arr)/sizeof(arr[0]); sort(arr, arr+n); cout


// C++ Program for counting sort #include #include using namespace std; #define RANGE 255 // The main function that sort // the given string arr[] in // alphabatical order void countSort(char arr[]) { // The output character array // that will have sorted arr char output[strlen(arr)]; // Create a count array to store count of inidividul // characters and initialize Read more…


/* C program for Merge Sort */ #include #include // Merges two subarrays of arr[]. // First subarray is arr[l..m] // Second subarray is arr[m+1..r] void merge(int arr[], int l, int m, int r) { int i, j, k; int n1 = m – l + 1; int n2 = r – m; /* create temp arrays */ int L[n1], Read more…


// C++ program to illustrate // recursive approach to ternary search #include <bits/stdc++.h> using namespace std; // Function to perform Ternary Search int ternarySearch(int l, int r, int key, int ar[]) { if (r >= l) { // Find the mid1 and mid2 int mid1 = l + (r – l) / 3; int mid2 = r – (r – Read more…


#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int num[n]; for(int i=0;i<n;i++){ cin>>num[i]; } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ if(num[j+1]>num[j]){ temp =num[j]; num[j]=num[j+1]; num[j+1]=temp; } } } }


#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int num[n]; for(int i=0;i<n;i++){ cin>>num[i]; } for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ if(num[i]>num[j]){ swap(num[i],num[j]); } } } }


#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int num[n]; for(int i=0;i<n;i++){ cin>>num[i]; } for(int i=1;i<=n;i++){ x=num[i]; j=j-1; while(j>=1 && num[j]>x){ num[j+1]=num[j]; j–; } num[j+1]=x; } }


#include <bits/stdc++.h> using namespace std; int binarySearch(int array[],int size,int searchValue); int main(){ int a[]={12,22,34,47,55,67,82,98}; int userValue; cout<<“Enter an integer : “<<endl; cin>>userValue; int result=binarySearch(a,8,userValue); if(result>=0){ cout<<“The number ” <<a[result]<<“was found at the element with index”<<result<<endl; } else{ cout<<“The number “<<userValue<<“was not found”<<endl; } } int binarySearch(int array[],int size,int searchValue){ int low=0; int high=size-1; int mid; while(low<=high){ mid=(low+high)/2; if(searchValue==array[mid]){ return mid; Read more…


Definition : let p and q be propositions. The conjuction of p and q denoted by p ^ q is the proposition ” p and q “. The conjuction of p and q is true when both p and q are true . otherwise false. p q p^q T T T T F F F T F F F F Read more…


Propositions : A proposition is a declarative sentence that is either true or false but not both.Example- 1 . A week has seven days. 2.Parrot is the smallest bird. 3.1+1=2 4.2+2=5 Here 1 and 3 is true . but 2 and 4 are false. So these sentences are propositions. Some sentences are not proposition. Example – 1.what is your name? Read more…


           Laravel Documentation introduction Part – 2 In previous part , we talked about some of laravel’s  functions. Now we will discuss more. 5. Laravel Vapor Compatibility : laravel 6 provides compatibity with laravel Vapor  an auto -scaling serverless deployment platform for laravel . Vapor abstracts the complexity of managing laravel applications on AWS  Lambda as well as interfacing those Read more…


uri-online judge

Larvel Routing 1. Basic routing : The most basic laravel routes accept a URI and a closure providing a very simple and expressive method of defining routes. Route::get(‘foo’,function(){ return ‘Hello World’; }); 2. Default Route Files : All laravel files are defined in route files which is located in routes directory . The routes/web.php file is for web interface .These Read more…


How to install laravel

How to install laravel We will discuss laravel installation step by step: 1. Server Requirements : laravel has some server requirements . All of these requirements are satisfied by the laravel homestead virtusal machine .So it is highly recommeended to use Laravel Homestead as local laravel development environment. If you are not using homestead as local server , make sure Read more…


laravel tutorials

Documentation Introduction We will discuss many important topics in this part. They are given serially below : 1. Versioning Scheme : laravel and it’s other first party packages follow semantic versioning . When referencing the laravel framework on it’s component from your application or package , you should always use a version constraint as ^6.0. however we strive to always Read more…


laravel tutorials

Today We will discuss something more about laravel functionality. In previous post, we learned about some very important functionality of laravel. laravel framework tutorial. Let’ s learn Something More… MVC framework : Laravel known as MVC framework. MVC means model-view -controller framework compare to other php framework , MVC framework basically works using software architectural design pattern and it’s general Read more…


laravel tutorials

In previous post , we discussed about features of laravel. Now let’s learn some functions of laravel. Functions of Laravel framework : Database Migration: Database Migration feature in your project not only saves time but also save much frustration. Your databse schema is the structure of your database including table in the databse , column and all information in the Read more…


laravel tutorials

Best features of Laravel –  Laravel is a php framework use to develop web applications like E-commerce website , CRM ,portals and more. Laravel is capable of handling all of the commonly used tasks such as authentication , routing, database interaction ,email and more. In laravel , its easy to authenticate i any web applications. so this is why , Read more…


laravel tutorials

Reasons to Choose Laravel framework Reasons to Choose Laravel framework. Over many years people used many frameworks in many programming languages like WordPress, laravel ,CodeIgniter and more. All framework has their own unique features and capabilities , used when developer developing their web applications. laravel framework tutorial. Reasons to Choose Laravel framework. Why You Should Use Laravel Framework ? !Why Read more…


laravel tutorials

what is Laravel ? Before learning Laravel, we should know what is laravel . Laravel is free ,open-source PHP framework. Laravel created by Tylor Otwell and intended for the development of web applications following the model-view-controller ( MVC ) architechtural pattern and laravel based on Symfony. Laravel For Beginners. Some of features of laravel are a modular package System along Read more…


uri-online judge

  Easy Programming Solutions & Tutorials Learn easy method of programming solutions and best tutorials   Solution URI Online Judge | 1029 Fibonacci Solution URI Online Judge | 1029 Fibonacci, How Many Calls? uri online judge 1002 solution . Man blogs on what is programming language computer programming for beginners computer programming c++ computer programming pdf computer programming courses basic computer programming what Read more…


How to install laravel

Easy Programming Solutions like Solution :: URI Online Judge | 2493 Jogo do Operador as uri online judge 1001 , solution uri online judge sign up,  uri online judge solution uri online judge problem solution in c online judge for beginners , Solution :: URI Online Judge | 2493 Jogo do Operador uri online judge 1002 solution . Man blogs Read more…




Calender

November 2019
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930