The document discusses various data structures for representing sets and algorithms for performing set operations on those data structures. It describes representing sets as linked lists, trees, hash tables, and bit vectors. For linked lists, it provides algorithms for union, intersection, difference, equality testing, and other set operations. It also discusses how bit vectors can be used to efficiently represent the presence or absence of elements in a set and perform operations using bitwise logic.
Trees. Defining, Creating and Traversing Trees. Traversing the File System
Binary Search Trees. Balanced Trees
Graphs and Graphs Traversal Algorithms
Exercises: Working with Trees and Graphs
Trees. Defining, Creating and Traversing Trees. Traversing the File System
Binary Search Trees. Balanced Trees
Graphs and Graphs Traversal Algorithms
Exercises: Working with Trees and Graphs
In DBMS (DataBase Management System), the relation algebra is important term to further understand the queries in SQL (Structured Query Language) database system. In it just give up the overview of operators in DBMS two of one method relational algebra used and another name is relational calculus.
Introduction to Relational algebra in DBMS - The relational algebra is explained with all the operations. Some of the examples from the textbook is also solved and explained.
It covers- Introduction to R language, Creating, Exploring data with Various Data Structures e.g. Vector, Array, Matrices, and Factors. Using Methods with examples.
In DBMS (DataBase Management System), the relation algebra is important term to further understand the queries in SQL (Structured Query Language) database system. In it just give up the overview of operators in DBMS two of one method relational algebra used and another name is relational calculus.
Introduction to Relational algebra in DBMS - The relational algebra is explained with all the operations. Some of the examples from the textbook is also solved and explained.
It covers- Introduction to R language, Creating, Exploring data with Various Data Structures e.g. Vector, Array, Matrices, and Factors. Using Methods with examples.
Consider the subset S = {0, 2, 4, 6, 8, 10, 12} of Z14Z. (a) Show t.pdfforecastfashions
Consider the subset S = {0, 2, 4, 6, 8, 10, 12} of Z/14Z. (a) Show that S = {0, 2, 4, 6, 8, 10, 12}
forms a subring of Z/14Z. (b) Show that S forms a unital ring. (c) Show that S is not a unital
subring of Z/14Z.
Solution
(a) Notice that all elements of S can be written as 2k
Let 2k, 2j in S
Then 2k+2j = 2(k+j) is in S, so clearly sum is in S
Also (2k)(2j) = 4kj = 2(2kj) is in S and so product is also in S
We can also see that 0, the additive identity of Z/14Z is in S by definition
Finally if 2k is in S, then -2k is in S and so S is subring of Z/14Z
(b) The ring has identity 8
Because 2.8 = 16=2, 4.8= 32 = 4, 6.8 = 48 = 6, 8.8 = 64 = 4, 10.8 = 80 = 10, 12.8 = 96 = 12
Hence S is unital
(c) As we can see that we have {2,4,6,10,12} and here 8 is missing and so S is not unital subring
of Z/14Z.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Enhancing Performance with Globus and the Science DMZGlobus
ESnet has led the way in helping national facilities—and many other institutions in the research community—configure Science DMZs and troubleshoot network issues to maximize data transfer performance. In this talk we will present a summary of approaches and tips for getting the most out of your network infrastructure using Globus Connect Server.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
4. Simplest and straight forward
Best suited for dynamic storage facility.
This allow multiplicity of elements ie; Bag structure.
All operations can be easily implemented and
performance of these operations are as good as
compared to other representations.
Ex: set S = { 5,6,9,3,2,7,1} using linked list structure is
5 6 9 3
1 7 2
6. ALGORITHM : UNION_LIST_SETS(Si,Sj;S)
Input: Si and Sj are header of two single linked list
representing two distinct sets.
Output: S is the union of Si and Sj.
Data structure: Linked list representation of set.
7. STEPS
/* to get a header note for S and initialize it*/
1. S= GETNODE(NODE)
2. S.LINK= NULL, S.DATA = NULL
/* to copy the entire list of Si into S*/
3. ptri = si.LINK
4. While (ptri !=NULL) do
1.Data = ptri.data
2.INSERT_SL_FRONT(S, DATA)
3. ptri= ptri.LINK
5.Endwhile
/* for each element in Sj added to S if it
6.ptrj=Sj.LINK
is not in Si*/
8. 7. While (ptrj!=NULL) do
ptri=Si.link
while (ptri. DATA != ptrj. DATA) do
1. ptri=ptri.LINK
8. Endwhile
9.If (ptri=NULL) then
INSERT_SL_FRONT(S,ptrj.DATA)
10. EndIf
11. ptrj=ptrj.LINK
12. Endwhile
13. Return (S)
14. stop
10. ALGORITHM :
INTERSECTION_LIST_SETS(Si,Sj;S)
Input: Si and Sj are header of two single linked list
representing two distinct sets.
Output: S is the intersection of Si and Sj.
Data structure: Linked list representation of set.
11. STEPS:
/*To get a header node for S and initialize it*/
1. S= GETNODE(NODE)
2. S. LINK= NULL, S. DATE= NULL
/*search the list Sj, for each element in Si*/
3. ptri= Si.LINK
4. While (ptri!= NULL) do
1. ptrj= Sj.LINK
2. While(ptrj.DATA!= ptri.DATA) and(ptrj !=NULL) do
1. ptrj= ptrj. LINK
12. 3. Endwhile.
4. If (ptrj!=NULL) then // when the element is found in Sj
1. INSERT_SL_FRONT(S,ptrj,DATA)
5. EndIf
6. ptri = Si.LINK
5. Endwhile
6. Return(S)
7.Stop.
14. ALGORITHM :
DIFFERENCE_LIST_SETS(Si,Sj;S)
Input: Si and Sj are header of two single linked list
representing two distinct sets.
Output: S is the difference of Si and Sj.
Data structure: Linked list representation of set.
15. STEPS:
/*Get a header node forS and initialize it*/
1.S= GETNODE(NODE )
2. S.LINK= NULL,S. DATA =NULL
/*Get S’ the intersection of Si, and Sj*/
3. S‟= INTERSECTION _LIST_SET_(Si, Sj)
/* Copy the entire list Si into S*/
4.ptri= Si. LINK
5. While (ptri.LINK!=NULL) do
1. INSERT_SL_FRONT(S.ptri.DATA)
2. ptri=ptri.LINK
6. Endwhile
16. /* For each element in S’. Delete it from S if it is there*/
7.ptr= S‟.LINK
8.While (ptr!=NULL) do
1. DELETE_SL_ANY(S,ptr.DATA)
2. ptr=ptr.LINK
9. Endwhile
10.Return (S)
11.Stop.
17. ALGORITHM :
EQUALITY_LIST_SETS(Si,Sj)
Input: Si and Sj are header of two single linked list
representing two distinct sets.
Output: Return TRUE if two sets Si and Sj equal else
FALSE
Data structure: Linked list representation of set.
18. STEPS
1. li= 0, lj =0
2.ptr=Si.LINK // to count Si
3.while (ptr!=NULL) do
1. li=li+1
2. ptr=ptr.LINK
4.Endwhile
5. ptr=Sj.LINK //to count Sj
6. While (ptr!=NULL) do
1. lj=lj+1
2. ptr=ptr.LNIK
7.Endwhile
8. If (li !=lj) then
1. flag = FALSE
2. exit .
9.Endif /*compare the elements in Si and Sj*/
19. 10. ptri= Si.LINK,flag=TRUE
11. While (ptril!=NULL )and (flag = TURE) do
1. ptrj=sj.LINK
2. while (ptrj.DATA !=ptri.DATA)and
(ptrj!=NULL) do
1.ptrj=ptrj.LINK
3. Endwhile
4.ptri=ptri.LINK
5. If (ptrj= NULL)then
1. flag= FALSE
6.Endif
12. Endwhile
13.Return(flag)
14.Stop.
20.
21. ►Here a tree is used to represent one set, and the each
element in the set has the same root.
►Each element in a set has pointer to its parent.
►Let us consider sets S1 ={1,3,5,7,9,11,13}
S2 ={2,4,8}
S1
S3 ={6}
S2 S3
1
6
2
3 5 7 9
S3 ={6}
4 8
11 13
S1 ={1,3,5,7,9,11,13} S2 ={2,4,8}
25. Here the elements in collection are separated in to
number of buckets.
Each bucket can hold arbitrary number of elements.
Consider set S ={2,5,7,16,17,23,34,42}
Here hash table with 4 buckets and H(x) hash function
can store which can place element from S to any of the
four buckets.
Bucket 1 16
Bucket 2
5 17
Bucket 3 2 34 42
Bucket 4 7 23
26. A B C B N
-- Q
D E E S
F --
G V S T
-- --
H I J I
K L X K Z
Set Si Set Sj
27. UNION: S = Si U Sj
A B C N
Q
D E S
F
G V U T
--
H I J
K L X Z
28. INTERSECTION DIFFERENCE
B A C
-- --
E D
-- F
-- G
-- --
I H J
K L
Si Sj Si -Sj
29.
30. VARIATION OF
SETS
MAINTAINING THE
MAINTAINING ACTUAL INDICATION OF
DATA VALUE PRESENCE OR
ABSENCE OF DATA
31. A set, giving the records about the age of cricketer
less than or equal to 35 is as given below:
{0,0,0,0,1,1,1,1,0,1,1}
Here 1 indicates the presence of records having the
age less than or equal to 35.
0 indicates the absence of records having the age less
than or equal to 35.
As we have to indicate presence or absence of an
element only, so 0 or 1 can be used for indication for
saving storage space
A bit array data structure is known for this purpose.
A bit array is simply an array containing values 0 or
1(binary).
32. • It is very easy to implement set operation on the bit
array data structure.
• The operations are well defined only if the size of the
bit arrays representing two sets under operation are of
same size.
33. To obtain the union of sets si and sj, the bit-wise
OR operation can be used
Si and Sj are given below:
Si = 1001011001
Sj = 0011100100
Si U Sj = 1 0 1 1 1 1 1 1 0 1
34. ALGORITHM :
UNION_BIT_SETS(Si,Sj;S)
Input: Si and Sj are two bit array corresponding to two
sets.
Output: A bit array S is the result of Si U Sj.
Data structure: Bit vector representation of set.
35. 1. li=LENGTH(Si) //Size of Si.
2. li=LENGTH(Sj) //Size of Sj.
3. If (li != lj) then
1.Print “Two sets are not compatible for union”
2.Exit
4. End if
/*Loop over the under lying bit arrays and bit-
wise OR on its constituents data.*/
5. For i=1 to li do
1.S[i] = Si[i] OR Sj[i]
6. EndFor
7. Return(S)
8. Stop
36. To obtain the intersection of sets si and sj, the bit-
wise AND operation can be used
Si and Sj are given below:
Si = 1001011001
Sj = 0011100100
Si Sj = 0 0 0 1 0 0 0 0 0 0
37. ALGORITHM :
INTERSECTION_BIT_SETS(Si,Sj;S)
Input: Si and Sj are two bit array corresponding to two
sets.
Output: A bit array S is the result of Si Sj.
Data structure: Bit vector representation of set.
38. 1. li=LENGTH(Si) //Size of Si.
2. li=LENGTH(Sj) //Size of Sj.
3. If (li != lj) then
1.Print “Two sets are not compatible for
intersection”
2.Exit
4. End if
/*Loop over the under lying bit arrays and
bit-wise AND on its constituents data.*/
5. For i=1 to li do
1.S[i] = Si[i] AND Sj[i]
6. EndFor
7. Return(S)
8. Stop
39. The difference of Si from Sj is the set of values
that appear in Si but not in Sj. This can be
obtained using bit-wise AND on the inverse of Sj.
Si and Sj are given below:
Si = 1001011001
Sj = 0011100100
Sj’ =11 00011011
S = Si – Sj = Si Sj’ =
1000011001
40. ALGORITHM :
DIFFERENCE_BIT_SETS(Si,Sj;S)
Input: Si and Sj are two bit array corresponding to two
sets.
Output: A bit array S is the result of Si and Sj.
Data structure: Bit vector representation of set.
41. STEPS:
1. li=LENGTH(Si) //Size of Si.
2. lj=LENGTH(Sj) //Size of Sj.
3. If (li != lj) then
1.Print “Two sets are not compatible for difference”
2.Exit
4. End if /*To find the inverse (NOT) of Sj.*/
5. For i=1 to li do
1.Sj[i] = NOT Sj[i]
6. EndFor /*Loop over the under lying bit arrays and
bit-wise AND*/
7. For i=1 to li do
1.S[i] = Si[i] AND Sj[i]d
8. EndFor
9. Return(S)
10. Stop
42. The equality operation is used to determine whether two
sets Si and Sj are equal or not.
This can be achieved by simple comparison between the
pair-wise bit values in two bit arrays.
43. ALGORITHM :
EQUALITY_BIT_SETS(Si,Sj)
Input: Si and Sj are two bit array corresponding to two
sets.
Output: Return TRUE if they are equal else FALSE.
Data structure: Bit vector representation of set.
44. 1. li=LENGTH(Si) //Size of Si.
2. li=LENGTH(Sj) //Size of Sj.
3. If (li != lj) then
1.Return (FALSE) //return with failure
2.Exit
4. End if
/*Loop over the under lying bit arrays and compare*/
5. For i=1 to li do
1.SJ[i] != Sj[i] then
1.Return (FALSE) //return with failure
2.Exit
2.EndIf
6. EndFor
/*Otherwise two sets are equal */
7. Return(TRUE)
8. Stop
45.
46. Let us consider a technique of storage and retrieval
of information using bit strings.
A bit string is a set of bits that is a string of 0’s
and 1’s for example 1000110011 is a bit string.
Let us now see how the information can be stored
and retrieved using bit string.
Let us assume a simple database to store the
information of 10 students.
In the sample database we have assumed the
information structure as stated below:
47. NAME REG SEX DISCIPLINE MODULE CATEGORY ADDRESS
NO
AAA A1 M CS C SC ---
BBB A2 M CE P GN ---
CCC A3 F ME D GN ---
DDD A4 F EC D GN ---
EEE A5 M EE P ST ---
FFF A6 M AE C SC ----
GGG A7 F ME C ST ---
HHH A8 M CE D GN ---
III A9 F CS P SC ---
JJJ A10 M AE P ST ---
A SAMPLE DATA BASE WITH 10 RECORDS
48. Name : String of Characters of length 25.
RegnNo : Alpha numeric string of length 15.
Sex : A single character value coded as
F=Female M=Male
Discipline: Two character value coded as:
AE-Agricultural Engineering
CE-Civil Engineering
CS-Computer Science and Engineering
EC-Electrical and Communication Engineering
EE-Electrical Engineering
ME-Mechanical
Module : One character value coded as
C = Certificate P=Diploma D= Degree
Category: Two character value coded as
GN=General SC=Scheduled Caste
ST=Schedule d tribe OC=Other Category
Address : Alpha numeric String of length 50
49. Length of bit string = number of records(here 10).
To store a particular column we require Bit Arrays storing a set of
bit string.
The number of bit arrays will be determined by different attributes
that the field may have.
For ex:
Sex : 2 for M or F
Discipline : 6 for six different branches
Module : 3 for three different streams
Category : 4 for different categories
All together 15 bit arrays each of length 10 in this case is required
to store the information.
Hence in the bit array in the „i‟th position of the bit string ,a „1‟ means
the existence and „0‟ means the absence of such attribute for the
‘i’th record.
50. ARRAY BIT STRING
M 1100110101
F 0011001010
AE 0000010001
CE 0100000100
CS 1000000010
EC 0001000000
EE 0000100000
ME 0000010000
C 0010001000
P 0100100011
D 0011000100
GN 0111000100
SC 1000010010
ST 0000101001
OC 0000000000
51. How many students are there in engineering and
computer discipline?
To retrieve this information only bit arrays CS needs to
be searched for the number of 1‟s in it.
Who are the female students in CS discipline?
For this information do F CS or
[0 0 1 1 0 0 1 0 1 0] [1 0 0 0 0 0 0 0 1 0] =
[000000010]
Thus it gives the 9th record only.
How many students of General Category are there in
diploma or degree Module?
GN [P D]
52. Efficient in terms of storage point of view
If v = number of bit arrays
r = number of records
Total bits needed = v*r;
In our example 15*10 = 150 bits.
In contrast if we are using conventional method we
may need 10 bytes for sex and module, 20 bytes for
each Discipline and Category thus total 60 bytes=480
bits
53. From computation point of view this technique is
efficient because no searching is involved.
A record can be computed through logical operations
like AND,OR,NOT and hence giving fast computations.
One drawback of this technique is that it is not possible
to store all kind of information. For example , the field
where all or nearly all the values are different ,like name,
regno, address this technique is in efficient.