Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles on Trending Technologies
Technical articles with clear explanations and examples
Difference between Application context and Beanfactory in Spring framework
The Spring framework provides two IoC (Inversion of Control) containers for managing, configuring, and manipulating beans − BeanFactory and ApplicationContext. The ApplicationContext interface extends BeanFactory to provide additional enterprise-level functionality. In modern Spring versions, ApplicationContext has largely replaced BeanFactory, though BeanFactory still exists for backward compatibility. Since Spring 2.0 and above, the BeanPostProcessor extension point is used extensively. If you use BeanFactory directly, some features such as AOP proxying and transaction management will not work without extra manual configuration. BeanFactory BeanFactory is the simplest IoC container. It uses lazy loading − beans are created only when ...
Read MoreDifference between lazy and eager loading in Hibernate
Lazy and Eager are two data loading strategies used in ORM frameworks such as Hibernate and EclipseLink. These strategies determine when related entities are fetched from the database − for example, when an Employee entity has a reference to a collection of Phone entities. Lazy Loading Lazy Loading means associated data is loaded only when you explicitly access it (by calling a getter or size method). Until that point, the related data is not fetched from the database. Use Lazy Loading when − You are working with one-to-many or many-to-many collections. You are not always ...
Read MoreTypes of Relations
A relation on a set can have various properties that classify it into different types. Understanding these types is essential for studying equivalence classes, partial orders, and other structures in discrete mathematics. Empty Relation The empty relation between sets X and Y, or on a set E, is the empty set ∅. No element is related to any other element. Full Relation The full relation (or universal relation) between sets X and Y is the entire Cartesian product X × Y. Every element in X is related to every element in Y. Identity Relation The identity relation on set X is ...
Read MoreSum of Degrees of Vertices Theorem
The Sum of Degrees of Vertices Theorem (also known as the Handshaking Lemma) is a fundamental result in graph theory that relates the sum of all vertex degrees to the number of edges in a graph. The Theorem If G = (V, E) is a non-directed graph with vertices V = {V1, V2, …, Vn}, then − ∑i=1n deg(Vi) = 2|E| This is because each edge contributes exactly 2 to the total degree sum − one for each of its endpoints. Example Each edge adds 2 to total degree ...
Read MoreRooted and Binary Tree
A rooted tree G is a connected acyclic graph with a special node called the root, from which every edge directly or indirectly originates. An ordered rooted tree is a rooted tree where the children of each internal vertex are ordered. If every internal vertex has not more than m children, it is called an m-ary tree. If every internal vertex has exactly m children, it is called a full m-ary tree. If m = 2, the rooted tree is called a binary tree. Rooted Tree (root = a) ...
Read MoreRepresentation of Relations using Graph
A relation can be represented visually using a directed graph (digraph). This graphical representation makes it easy to understand which elements are related and in what direction. How to Represent a Relation as a Graph The rules for converting a relation into a directed graph are − The number of vertices equals the number of elements in the set. For each ordered pair (x, y) in the relation R, draw a directed edge from vertex x to vertex y. If there is an ordered pair (x, x), draw a self-loop on vertex x. Example ...
Read MoreRepresentation of Graphs
There are mainly two ways to represent a graph in computer science − Adjacency Matrix − A 2D array showing connections between vertices. Adjacency List − An array of linked lists showing neighbors of each vertex. Adjacency Matrix An adjacency matrix A[V][V] is a 2D array of size V × V where V is the number of vertices. For an undirected graph, if there is an edge between Vx and Vy, then A[Vx][Vy] = 1 and A[Vy][Vx] = 1 (the matrix is symmetric). For a directed graph, if there is an edge from Vx to ...
Read MoreRelations of a Set
A relation describes a connection or association between elements of sets. Relations may exist between objects of the same set or between objects of two or more sets. Definition and Properties A binary relation R from set X to set Y (written as xRy or R(x, y)) is a subset of the Cartesian product X × Y. Each element of R is an ordered pair (x, y) where x ∈ X and y ∈ Y. More generally, an n-ary relation R between sets A1, A2, ..., An is a subset of the Cartesian product A1 × A2 ...
Read MoreThe Predicate Calculus
Predicate Calculus (also called first-order logic) extends propositional logic by dealing with predicates − statements that contain variables. While propositional logic works with fixed true/false statements, predicate calculus allows us to express properties of objects and relationships between them. Predicate A predicate is an expression of one or more variables defined on some specific domain. A predicate with variables can be made a proposition by either assigning a value to the variable or by quantifying the variable. Consider the statement − "Ram is a student." "is a student" is the predicate (P), and "Ram" is ...
Read MorePower Set
The power set of a set S is the set of all subsets of S, including the empty set and S itself. The power set is denoted as P(S). If S has n elements, then its power set has 2n elements. Example For a set S = { a, b, c, d }, let us list all the subsets grouped by size − Subsets with 0 elements: { ∅ } Subsets with 1 element: { a }, { b }, { c }, { d } Subsets with 2 elements: { a, ...
Read More