If A and B are sets, several other sets can be constructed from them: the intersection of A and B, АПВ3 (x: хEA and x € B}; /| B N A = A N B. the union of A and B, AUB 3 (x: x Е A or x € B}; // BUA = A U B. and the set difference, A but not B, A\B {x: x € A and x ¢ B}. // Is B \ A = A \ B? // The set A \ B is sometimes called the "relative complement" of B in A. When A N B = Ø, sets A and B are said to be disjoint. /| A and B have no common element. The number of elements in a set S is called the cardinality of S and denoted by |S|. When this is a finite number, then |S| e N, and when |S = n, we’ll say that S is an n-set. For any pair of sets, |AUB| = |A|+|B| – |AN B|, and when A and B are disjoint, |AUB| = |A|+ |B|. // since AN B = Ø Furthermore, we always have |AUB| = |A \ B| +|B \ A| + |A N B|. Example 2.1.1: Operations, Sizes, and Subsets Suppose A is the set of odd integers less than 10 and B is the set of primes less than 10. Then = {2,3,5,7} A = {1,3,5,7,9} and ANB = {3,5,7} and AUB = {1,2,3,5,7,9} A \ B = {1,9} and B \ A = {2}; - |AN B| = 5+4 – 3 = |A \ B| + |B \ A| + |A N B| = 2+1+3. 6 = |AUB| = |A| + |B|
Types of Linked List
A sequence of data elements connected through links is called a linked list (LL). The elements of a linked list are nodes containing data and a reference to the next node in the list. In a linked list, the elements are stored in a non-contiguous manner and the linear order in maintained by means of a pointer associated with each node in the list which is used to point to the subsequent node in the list.
Linked List
When a set of items is organized sequentially, it is termed as list. Linked list is a list whose order is given by links from one item to the next. It contains a link to the structure containing the next item so we can say that it is a completely different way to represent a list. In linked list, each structure of the list is known as node and it consists of two fields (one for containing the item and other one is for containing the next item address).
Let A be the set {1,3,5,7,9} and B be the set {1,2,4,8} . Find |A⋃B|
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images