Day 36: Set Theory Laws

Hello Dear Students,  Hope you all are doing good. Aaj hum set theory ke laws and principles ke baare mein study karenge, So, let's get started.... 1. ABSORPTION LAW - Absorption law states that A∪(A∩B) = A A∩(A∪B) = A 2. ASSOCIATIVE LAW - The Association law states that A∪(B∪C)=(A∪B)∪C A∩(B∩C)=(A∩B)∩C 3. COMMUTATIVE LAW - The Commutative law states that A∪B=B∪A A∩B=B∩A 4.COMPLEMENT LAW - The complement law states that A∩A c =Φ A∪A c =U 5. COMPLEMENTATION LAW - The Complementation law states that (A c ) c  = A 6. DE-MORGAN'S LAW  - The De-Morgan's law states that (A∩B) c = A c ∪B c (A∪B) c = A c ∩B c 7. DISTRIBUTIVE LAW - The Distributive law states that A∪(B∩C) = (A∪B)∩(A∪C) A∩(B∪C) = (A∩B)∪(A∩C) 8. DOMINANT LAW - The Dominant law states that A∩Φ=Φ A∪U=U 9. IDEMPOTENT LAW - The Idempotent law states that A∪A=A A∩A=A 10. IDENTITY LAW - Identity Law states that   A∪Φ = A  A∩U = A Other laws and principles of se

Day 35: Relations

Hello Dear Students, Hope you all are doing good. Aaj hum set relations ke baare mein study karenge, Let's get started.... RELATIONS -  Relations basically derives from Cartesian Product.  For example, let A={1,2} and B={a,b}, then, Cartesian product AxB = { (1,a),(1,b),(2,a),(2,b) }.  So, ab hum AxB mein se Relation ko choose karenge, So, relation can be { (1,a),(2,a),(2,b) }.  So in simple words for understanding, 2 sets ke Cartesian product se relation derived hota hai.  Formal definition, Let A and B be 2 non-empty sets, then a relation R from A and B is a subset of AxB. R⊆AxB. Important point to be considered that, Rmax = AxB , that is the maximum number of elements in relation is obviously as same as AxB, the cartesian product, and Rmin = {Φ}, phi means empty set. So, because phi is subset of every set, so the minimum number of elements or sets in relation is Φ. The total number of relations can be 2 m.n , where m=number of elements in set 1, and n=

Day 34: Set Theory

Hello Dear Students, Hope you all are doing good. Aaj hum Sets ke baare mein study karenge, sets, its operations, and many more..  Let's get started... SET -  Set means collection basically.  In mathematics, Set is a collection of elements , and the elements are well defined and well distinct.  Set is denoted by capital letter such as set A, set X. The elements in the set is denoted by small letters such as a,b,c,d.  For an example, X={1,2,3} and Y={a,b,c,...} The above X and Y are the 2 sets and the elements of the sets are in between the curly braces.  Set can be represented in 2 ways- 1st way is known as Tabular method or Raster method or Enumeration method. In this, set is represented as A={1,2,3}. 2nd way is known as Selector method or Set Builder method or Rule method. In this, set is represented in statement form basically, for example, A={x|x ∈ w and x is divisible by 2}.  SUBSET - Subset means 1 set se derived doosra set. Let X and Y are 2 sets, X is subset of Y if every

Day 33: Mathematical Logic

Hello Dear Students,  Hope you all are doing good. Aaj hum mathematical logic ke baare mein study karenge. Let's get started... Mathematical logic means simply jo logic se hum kisi problem ko solve karte hain. It is basically combination of both, mathematics, linguistics and theoretical computer science. Logic is basically of 2 types which are - Propositional Logic Predicate Logic PROPOSITIONAL LOGIC -  Propositional logic is fact that the solution can be even true or false but not both.  Propositional logic mein values only true hongi or false, but not both. We represent true as 1 and false as 0. For example, 3+3=6, it is a propositional logic with value True(1).  The logical operations on propositions are as follows- 1. Conjunction - Conjunction is described as "and". If 2 propositions are there, suppose p and q , then it is denoted as p^q .  Truth Table for p^q  p q  p^q  T  T  T  T  F  F  F  T  F  F  F  F  2. Disjunction - Disjunction is described as "or"

Day 32: Types of Graphs

Hello Dear Students,  Hope you all are doing good, Aaj hum graph types ke baare mein study karenge.  So, let's get started... Graph is a diagram or drawing which is collection of vertices(nodes) and edges. The various types of graphs are as follows-  DIRECTED GRAPH - Directed graph means jis graph mein edges ki direction ho, means how edges moves from one vertex to another and what is the direction. For example, In above graph, it is a directed graph because each edge shows a direction. e1 edge B to A ki direction mein point kar raha hai, e2 from B to C, and e3 from C to D. Edges are also known as Arcs . B to C move kar raha hai e2, then B is tail and C is head. e3 is from C to D, then C is tail and D is head. UNDIRECTED GRAPH - Undirected graph means graph jisme directions na ho and not a directed graph. For example, the below graph is undirected graph jisme edges ki directions nahi hai.  NULL GRAPH - Null graph is the graph jisme vertices hoti and but vertices ko connect karne

Day 31: Tree vs Graph

Hello Dear Students,  Hope you all are doing good. Aaj hum basic topic tree vs graph ko study karenge which is an important topic to understand.  Let's get started.... Graph is diagram or drawing which is collection of nodes and edges.  Tree is also a collection of nodes and edges.  But graph and tree mein yeh difference hai ki tree mein cycles nahi hote and graph has cycles.  Tree with cycles is known as Graph or a Graph without cycles is known as tree. Cycle means the path in which the starting and ending vertex is same.  For example, ek tree hai, uski nodes ka path only from parent node to child node hi hota hai, ek chlid node cycle form nahi kar sakti, for example, In above tree, agar hum B to B path find karenge, then it is not possible in tree because, hum B to B path define nahi kr sakte, means it is not cycle.Hum only B to A, B to D, B to E, path ko hi define kar sakte hain. Agar hume B to B path chahiye, then B to D and then D to E and then E to B hoga, but D and E mein ed

Day 30: Graph terminologies

Hello Dear Students,  Hope you all are doing good. So, aaj hum graphs ke baare mein study karenge, Let's get started... GRAPH - Graph is a diagram or drawing, jisme various vertices and edges hote hain, jo ki connected hote hain. Vertices is also known as points or nodes. Vertices mein hum data elements ko store karate hain and edges basically lines hoti hai jisse vertices ko connect kiya jata hai.  Mathematically, G = [ V(G) , E(G) ] , where G is Graph, V is the Vertex set of graph and E is the edge set of graph G. For example,  In the above graph, V={A,B,C,D} and E={AB,BC,CD,BD) and G=(V,E). GRAPH TERMINOLOGIES -  Graph mein various basic terminologies hain, which are as follows- PATH - Path means ek vertex se doosri vertex tak jaane ka raasta. Path is between edges, from one vertex to another, we move from one vertex to another.  For example, in above graph from A to C, the path can be - {A,<AB>,B,<BC>,C} Here, <AB> means the edge AB.  CYCLE - Cycle wo path

Day 29: Design Techniques

Hello Dear Students,  Hope you all are doing good. So, aaj hum data structure ke algorithms ki designing techniques ke baare mein study karenge, Let's get started... For designing and analyzing algorithms we use various approaches, Jab data structure mein algorithms bante hain, so use design and analyse karne ke liye hum various techniques ko use karte hain, which are as follows- Divide and Conquer Greedy Method Dynamic programming Back tracking Branch and Bound, etc. 1. DIVIDE AND CONQUER -  Divide and Conquer technique mein hum sabse pehle problem ko small units or pieces mein divide kar lete hain and then us par processing karte hain, then wo divided small units ko hum combine kar dete hain so that it should be processed and problem is solved.  Divide and Conquer technique ko hum merge sort and quick sort mein bhi apply karte hain.  Sorting techniques ke lecture mein humne ise discuss kiya tha.  Simple example is real world mein jab hum kuch kaam kar rahe hote hain, then agar 1

Day 28: Sorting Techniques

Hello Dear Students,  Hope you all are doing good. Aaj hum sorting techniques ke baare mein study karenge.. Let's get started... SORTING - Sorting means data ko ek particular order mein arrange kar dena. Jo bhi data hota hai wo hum data structure mein store kara dete hain but jab us data ko process kiya jata hai then wo difficult ho jata hai, so agar hum wohi data ko proper arrange kar kr store karayenge, then , complexity less ho jayegi and easy ho jayega data ko process karna.  Agar data numeric data hoga then wo ascending or descending order mein arrange kiya jayega. Agar data character data hoga then wo alphabetic order mein arrange kiya jayega. Sorting ke liye basically 2 techniques mein data ko sort kiya jata hai- 1. INTERNAL SORTING        a. Selection Sort       b. Bubble Sort       c. Insertion Sort       d. Merge Sort       e. Quick Sort       f. Heap Sort       g. Radix Sort       h. Shell Sort 2. EXTERNAL SORTING      a. Sorting with Tapes      b. Sorting with Disk Int

Day 27: Important Question

Hello Dear Students, Hope you all are doing good. Aaj hum ek important question ko understand karenge jo tree data structure ka question hai and last 2 times se exam mein a raha hai. Ye question important and very easy hai. Let's get started... Question is- Question- Here rectangle represents Maximum and Circle represents Minimum. The value of root node of the given tree is? Option A- 3 Option B- 6 Option C- 7 Option C- 5 So, ise solve karna is very simple and easy. Hume root node ki value ko find out karna hai, so hum kaise karenge? Firstly, sabse nicche wali nodes ( child nodes) ko dekhenge. Ab, left se shuru karte hain,  Note:- Rectangle means maximum value from the child nodes and circle means minimum value from the child nodes. So, 4 and 6 mein se maximum is 6, So root rectangle mein 6 a jayega. And aise hi 3 and 7 mein se maximum 7 hai so root rectangle mein 7 a jayega. Ab right mein, 5 and 2 mein se 5 is maximum so uske root rectangle mein 5 a jayega. And 2 and 3 mein se 3 i