#include <stdio.h> #include<iostream> #include<math.h> using namespace std; bool flag[20000002]; int primes[20000000]; void sieve(int n) { int index=0; primes[index++] = 2; for(int i=3; i<=n; i+=2) { if(flag[i] == 0) { primes[index++] = i; if(i...
Post-order traverse of a Tree with C program.
Post-order: Post-order traverse need to traverse left, then right then root. Array, Linked List, Queues, Stacks, etc. are linear traversal where have only one logical way to traverse them. Though trees can be traversed in different ways. That Traversals: In-order...
C program In-order Traversal of a Tree.
In-order Traversal of a Tree. In-order traversal is very commonly used on binary search trees(BST).Tt returns values from the underlying set in order, according to the comparator set up of the binary search tree. Array, Linked List, Queues, Stacks, etc. are linear...
C Program For Pre-order traversal in a Tree.
Pre-order traversal: Pre-order traverse need to traverse root, then left, then right. Array, Linked List, Queues, Stacks, etc. are linear traversal where have only one logical way to traverse them. Though trees can be traversed in different ways. That Traversals:...
Binary Tree with implementation using C.
Binary Tree: A binary tree each node has at most two children generally referred as left child and right child from root node. Components of Each node: Pointer to left subtree Pointer to right subtree Data element The topmost node in the tree is called...
Chapter 4 Relational Algebra
Relational Algebra The part of mathematics in which letters and other general symbols are used to represent numbers and quantities in formula and equations. Ex: (x + y) · z = (x · z) + (y · z). The main application of relational algebra is providing a theoretical...
Chapter 3 Components of the Database System Environment
Components of the Database System Environment There are five major components in the database system environment and their interrelationships are. Hardware Software Data Users Procedures Hardware: The hardware is the actual computer system used for keeping and...
Database basic overview
What is DBMS? A Database Management System (DBMS) is a collection of interrelated data and a set of programs to access those data. Database management systems (DBMS) are computer software applications that interact with the user, other applications, and the database...
Laravel – Scopes (3 Easy Steps)
Scoping is one of the superpowers that eloquent grants to developers when querying a model. Scopes allow developers to add constraints to queries for a given model. In simple terms laravel scope is just a query, a query to make the code shorter and faster. We can...