Data Structures and Algorithms are the building blocks of efficient software. By choosing the right data structure and algorithm for the task, programmers can create software that runs quickly and uses memory effectively.
Lecture 9: Dimensionality Reduction, Singular Value Decomposition (SVD), Principal Component Analysis (PCA). (ppt,pdf)
Appendices A, B from the book “Introduction to Data Mining” by Tan, Steinbach, Kumar.
Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends. One end is always used to insert data (enqueue) and the other is used to remove data (dequeue). Queue follows First-In-First-Out methodology, i.e., the data item stored first will be accessed first.
Data structure and algorithm using javaNarayan Sau
This presentation created for people who like to go back to basics of data structure and its implementation. This presentation mostly helps B.Tech , Bsc Computer science students as well as all programmer who wants to develop software in core areas.
Data Structures and algoithms Unit - 1.pptxmexiuro901
it is about data structures and algorithms. this ppt has all data structures like linkedlist, trees, graph,it is about data structures and algorithms. this ppt has all data structures like linkedlist, trees, graph,it is about data structures and algorithms. this ppt has all data structures like linkedlist, trees, graph,
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
More Related Content
Similar to Data Structures and Algorithms Fundamentals
Lecture 9: Dimensionality Reduction, Singular Value Decomposition (SVD), Principal Component Analysis (PCA). (ppt,pdf)
Appendices A, B from the book “Introduction to Data Mining” by Tan, Steinbach, Kumar.
Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends. One end is always used to insert data (enqueue) and the other is used to remove data (dequeue). Queue follows First-In-First-Out methodology, i.e., the data item stored first will be accessed first.
Data structure and algorithm using javaNarayan Sau
This presentation created for people who like to go back to basics of data structure and its implementation. This presentation mostly helps B.Tech , Bsc Computer science students as well as all programmer who wants to develop software in core areas.
Data Structures and algoithms Unit - 1.pptxmexiuro901
it is about data structures and algorithms. this ppt has all data structures like linkedlist, trees, graph,it is about data structures and algorithms. this ppt has all data structures like linkedlist, trees, graph,it is about data structures and algorithms. this ppt has all data structures like linkedlist, trees, graph,
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
The infamous Mallox is the digital Robin Hoods of our time, except they steal from everyone and give to themselves. Since mid-2021, they've been playing hide and seek with unsecured Microsoft SQL servers, encrypting data, and then graciously offering to give it back for a modest Bitcoin donation.
Mallox decided to go shopping for new malware toys, adding the Remcos RAT, BatCloak, and a sprinkle of Metasploit to their collection. They're now playing a game of "Catch me if you can" with antivirus software, using their FUD obfuscator packers to turn their ransomware into the digital equivalent of a ninja.
-------
This document provides a analysis of the Target Company ransomware group, also known as Smallpox, which has been rapidly evolving since its first identification in June 2021.
The analysis delves into various aspects of the group's operations, including its distinctive practice of appending targeted organizations' names to encrypted files, the evolution of its encryption algorithms, and its tactics for establishing persistence and evading defenses.
The insights gained from this analysis are crucial for informing defense strategies and enhancing preparedness against such evolving cyber threats.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...QADay
Lviv Direction QADay 2024 (Professional Development)
КАТЕРИНА АБЗЯТОВА
«Ефективне планування тестування ключові аспекти та практичні поради»
https://linktr.ee/qadayua
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
UiPath New York Community Day in-person eventDianaGray10
UiPath Community Day is a unique gathering designed to foster collaboration, learning, and networking with automation enthusiasts. Whether you're an automation developer, business analyst, IT professional, solution architect, CoE lead, practitioner or a student/educator excited about the prospects of artificial intelligence and automation technologies in the United States, then the UiPath Community Day is definitely the place you want to be.
Join UiPath leaders, experts from the industry, and the amazing community members and let's connect over expert sessions, demos and use cases around AI in automation as we highlight our technology with a special speaker on Document Understanding.
📌Agenda
3:00 PM Registrations
3:30 PM Welcome note and Introductions | Corina Gheonea (Senior Director of Global UiPath Community)
4:00 PM Introduction to Document Understanding
How to build and deploy Document Understanding process
Where would Document Understanding be used.
Demo
Q&A
4:45 PM Customer/Partner showcase
Accelirate
Intro to Accelirate and history with UiPath
Why are we excited about the new AI features of UiPath?
Customer highlight
a. Document Understanding – BJs Case Study
b. Document Understanding + generative AI
5.30 PM Networking
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/
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Data Structures and Algorithms Fundamentals
1.
2. Today's Agenda
Introduction to data Structures
Linear data structures
Nonlinear data structures
Applications
Real time applications
Algorithms
Analysis (Complexities)
Summary
3. What is
Programming ?
Programming is the process of
creating a set of instructions that tell a
computer how to perform a task.
Programming can be done using
a variety of computer programming
languages, such as Python, JAVA
C++, etc.
4. What is Data Structures ?
In computer science, a data
structure is
a data organization,
management, and storage
format that enables efficient
access and modification.
More precisely, a data
structure is a collection
of data values, the
relationships among them, and
the functions or operations
that can be applied to the data.
5. • Data Structure is a way of collecting and organising data in such a
way that we can perform operations on these data in an effective
way.
• Data Structures is about rendering data elements in terms of some
relationship, for better organization and storage.
6. EXAMPLE
we have some data which has,
player's name "Virat" and age 26. Here
"Virat" is of String data type and 26 is
of integer data type.
We can organize this data as a record
like Player record, which will have both
player's name and age in it. Now we can
collect and store player's records in a file or
database as a data structure. For example:
"Dhoni" 30, "Gambhir" 31, "Sehwag" 33
8. Linear Data Structure
Data structure where data
elements are arranged
sequentially or linearly where the
elements are attached to its
previous and next adjacent in
what is called a linear data
structure.
In linear data structure, single
level is involved. Therefore, we
can traverse all the elements in
single run only. Linear data
structures are easy to implement
because computer memory is
arranged in a linear way.
10. Array
• Array consisting of a collection of elements (values
or variables), each identified by at least
one array index or key.
• They are also used to implement many other data
structures, such as lists and strings.
12. Basic
Operations
in Array
Traverse : print all the array elements one
by one.
Insertion : Adds an element at the given
index
Deletion : Deletes an element at the given
index.
Search : Searches an element using the
given index or by the value.
Update : Updates an element at the given
index.
13. Types of Arrays
There are two types of Array
One Dimensional Array
Multidimensional Array
14. One
Dimensional
Array
• One dimensional (1-D) arrays or Linear arrays
• In it each element is represented by a single
subscript.
• The elements are stored in consecutive
memory locations.
16. Applications
• Implement mathematical vectors
and matrices.
• Implement other data structures,
such as lists, hash tables, deques,
queues and stacks.
17. Linked list
• In linked list, the elements are not stored at contiguous memory
locations.
• The elements in a linked list are linked using pointers
19. Types of Linked list
Single
linked list
Doubly
linked list
Circular
Linked list
20. Double
Linked list
• Contains an extra memory to store the address of
the previous node, together with the address of the
next node.
• we are storing the address of the next as well as the
previous nodes.
21. Circular
Linked list
• It is either a singly or doubly linked list in which
there are no NULL values.
• we can implement the Circular Linked List by
making the use of Singly or Doubly Linked List.
• In the case of a singly linked list, the next of the
last node contains the address of the first node
• In case of a doubly-linked list, the next of last
node contains the address of the first node and
previous of the first node contains the address of
the last node.
24. Applications
• Implementation of stacks and queues
• Performing arithmetic operations on
long integers
• Manipulation of polynomials by storing
constants in the node of linked list
25. Real Time
Applications
• Train - here each coach is connected to its
previous and next coach (Except first and
last).
• Image viewer – Previous and next images
are linked, hence can be accessed by next
and previous button.
• Previous and next page in web browser –
We can access previous and next URL
searched in web browser by pressing back
and next button since, they are linked as
linked list.
• Music Player – Songs in music player are
linked to previous and next song. you can
play songs either from starting or ending of
the list.
26. Stack
• Stack is a linear data
structure which follows a
particular order in which
the operations are
performed.
• The order may be
LIFO(Last In First Out)
27. Operations on Stack
Push
• Adds an item in the
stack using Push()
function.
• If the stack is full, then it
is said to be an Overflow
condition.
28. POP
• Removes an item from
the stack by using Pop()
function.
• The items are popped
in the reversed order in
which they are pushed.
• If the stack is empty,
then it is said to be an
Underflow condition.
29. Applications
Towers of Hanoi problem.
Balancing of symbols.
Infix to postfix conversions.
Histogram problems.
N –Queen problem.
Sudoku problem.
31. Queue
• A Queue follows a particular order in which the operations are
performed.
• The order is First In First Out (FIFO).
• The difference between Stacks and queues is in
removing.
• In a stack we remove the item the most recently added;
in a queue, we remove the item the least recently added.
35. Types of Queue
There are four types of
Queue data stucture
Simple Queue
Circular Queue
Double Ended Queue
Priority Queue
36. Circular Queue
• Unlike the simple queues, in a
circular queue each node is
connected to the next node in
sequence
• the last node’s pointer is also
connected to the first node’s
address.
37. Double Ended
Queue
• The doubly ended queue or dequeue allows the
insert and delete
• Operations from both ends (front and rear) of
the queue.
38. Priority Queue
• Priority queue makes
data retrieval possible only
through a pre- determined
priority number assigned to the
data items.
• While the deletion is
performed in accordance to
priority number (the data item
with highest priority is removed
first), insertion is performed only
in the order.
39. Applications of Queue
To implement printer
spooler so that jobs can be
printed in the order of
their arrival
Round robin scheduling
technique is implemented
using queue
All types of customer
service(like railway
reservation) centers are
designed using the
concept of queues.
40. Real Time Applications
Queue
• Queue of people at
any service point
such as ticketing etc.
1
Queue
• Queue of processes
in OS.
2
Queue
• Queue of packets in
data
communication.
3
Queue
• Queue of air planes
waiting for landing
instructions.
4
41. Non Linear Data Structures
The data structure where
data items are not
organized sequentially is
called nonlinear data
structure.
All the data elements in
nonlinear data structure
cannot be traversed in
single run.
43. Graphs
A graph is a pictorial representation of a set
of objects where some pairs of objects are
connected by links.
A graph data structure is a collection of
nodes that have data and are connected to
other nodes.
Formally, a graph is a pair of sets (V, E),
where V is the set of vertices and E is the set
of edges, connecting the pairs of vertices.
44. Example
On face book, everything is a
node. That includes User, Photo,
Album, Event, Group, Page,
Comment, Story, Video, Link,
Note...anything that has data is a
node.
Every relationship is an edge
from one node to another.
Whether you post a photo, join a
group, like a page etc., a new
edge is created for that
relationship.
45. Example Contd...
All of face book is then,
a collection of these
nodes and edges. This is
because face book uses
a graph data structure
to store its data.
46. Structure of graph
Graph is a data structure (V,E) that consists
of
• A collection of vertices V
• A collection of edges E, represented as
ordered pairs of vertices (u,v)
In this graph,
V= {0, 1, 2, 3}
E = {(0,1), (0,2), (0,3), (1,2)}
G = {V, E}
47. Graph
Terminology
• Adjacency: A vertex is said to be adjacent to another vertex if
there is an edge connecting them. Vertices 2 and 3 are
not adjacent because there is no edge between them.
• Path: A sequence of edges that allows you to go from vertex
A to vertex B is called a path. 0-1, 1-2 and 0-2 are paths
from vertex 0 to vertex 2.
• Directed Graph: A graph in which an edge
(U,V) doesn't necessary mean that there is an edge (V,U) as
well. The edges in such a graph are represented by arrows
to show the direction of the edge.
49. Adjacency Matrix
• An adjacency matrix is 2D array of V x V vertices.
Each row and column represent a vertex.
• If the value of any element a[i][j] is 1, it represents
that there is an edge connecting vertex i and vertex
j .
• Since it is an undirected graph, for edge (0,2), we
also need to mark edge (2,0); making the adjacency
matrix symmetric about the diagonal.
• Edge lookup(checking if an edge exists between
vertex A and vertex B) is extremely fast in
adjacency matrix representation but we have to
reserve space for every possible link between all
vertices(V x V), so it requires more space.
50. Adjacency List
• An adjacency list represents
a graph as an array of linked list.
• The index of the array represents a
vertex and each element in its
linked list represents the other
vertices that form an angle with
the vertex.
• An adjacency list is efficient in
terms of storage because we only
need to store the values for the
edges. For a graph with millions of
vertices, this can mean a lot of
saved space..
51. Operations
On graph
There are 4 types of operations
Check if element is present in graph
Graph Traversal
Add elements(vertex, edges) to
graph
Finding path from one vertex to
another
52. Types of Graphs
There are 15 types of graphs :
1.Finite graph 8.Pseudo graph 15. Cyclic graph
2.Infinite graph 9.Rectangular graph
3.Trivial graph 10.Bipartite graph
4.Simple graph 11.Weighted graph
5.Multi graph 12.Digraph
6.Null graph 13.Subgraph
7.Complete graph 14.Connected graph
53. Finite Graph
A graph is said to be finite if it has finite number of
vertices and finite number of edges.
54. Infinite graph
A graph is said to be infinite if it
has infinite number of vertices as
well as infinite number of edges.
55. Trivial Graph
A graph is said to be trivial if a finite graph contains only one
vertex and no edge.
56. Simple Graph
A simple graph is a graph which does not contains more
than one edge between the pair of vertices. A simple
railway tracks connecting different cities is an example of
simple graph.
57. Multi Graph
• Any graph which contain some parallel edges
but doesn’t contain any self-loop is called multi
graph. For example A Road Map.
• Parallel Edges: If two vertices are connected
with more than one edge than such edges are
called parallel edges that is many roots but one
destination.
• Loop: An edge of a graph which join a vertex to
itself is called loop or a self-loop.
58. Null Graph
A graph of order n and size zero that is a graph which contain
n number of vertices but do not contain any edge.
59. Complete Graph
• A simple graph with n vertices is
called a complete graph.
• if the degree of each vertex is n-1,
that is, one vertex is attach with n-1
edges.
• A complete graph is also called Full
Graph.
60. Pseudo Graph
A graph G with a self loop
and some multiple edges is
called pseudo graph.
61. Rectangular Graph
A simple graph is said to be regular if all
vertices of a graph G are of equal
degree. All complete graphs are regular
but vice versa is not possible.
62. Bipartite Graph
• A graph G = (V, E) is said to be bipartite graph
if its vertex set V(G) can be partitioned into
two non-empty disjoint subsets.
• V1(G) and V2(G) in such a way that each
edge e of E(G) has its one end in V1(G) and
other end in V2(G).
• The partition V1 U V2 = V is called Bipartite of
G.
Here in the figure:
V1(G)={V5, V4, V3}
V2(G)={V1, V2}
63. Weighted Graph
If the vertices and edges of a graph are
labelled with name, data or weight then
it is called labelled graph. It is also
called Weighted Graph.
64. Digraph
A graph G = (V, E) with a mapping f such
that every edge maps onto some ordered
pair of vertices (Vi, Vj) is called Digraph.
It is also called Directed Graph. Ordered
pair (Vi, Vj) means an edge between Vi
and Vj with an arrow directed from Vi to
Vj.
Here in the figure:
e1 = (V1, V2)
e2 = (V2, V3)
e4 = (V2, V4)
65. Subgraph
A graph G = (V1, E1) is called subgraph
of a graph G(V, E) if V1(G) is a subset of
V(G) and E1(G) is a subset of E(G) such
that each edge of G1 has same end
vertices as in G.
66. Connected
Graph
• A graph G is said to be connected if for any pair of vertices (Vi, Vj) of
a graph G are reachable from one another.
• Or a graph is said to be connected if there exist at least one path
between each and every pair of vertices in graph G, otherwise it is
disconnected.
• A null graph with n vertices is disconnected graph consisting of n
components. Each component consist of one vertex and no edge.
67. Cyclic graph
A graph G consisting of n vertices and
n> = 3 that is V1, V2, V3- – – – – – – – Vn
and edges (V1, V2), (V2, V3), (V3, V4)- –
– – – – – – — -(Vn, V1) are called cyclic
graph.
68. Applications of
Graphs
Computer Science: In computer science, graph is used to
represent networks of communication, data organization,
computational devices etc.
Physics and Chemistry: Graph theory is also used to study
molecules in chemistry and physics.
Social Science: Graph theory is also widely used in
sociology.
Mathematics: In this, graphs are useful in geometry and
certain parts of topology such as knot theory.
Biology: Graph theory is useful in biology and conservation
efforts.
69. Real Time
Applications
Social graphs
(Face book graph
API)
Knowledge
graphs (Google's
Knowledge
graphs)
Recommendation
Engines (Local
graph API)
Path optimization
Algorithms (
Google Maps,
Flight Network,
GPS Navigation
systems)
70. Trees
A tree is a nonlinear
hierarchical data structure
that consists of nodes
connected by edges.
71. Why Tree Data Structure ?
• Other data structures such as arrays, linked list, stack, and queue are linear data structures
that store data sequentially. In order to perform any operation in a linear data structure, the time
complexity increases with the increase in the data size. But, it is not acceptable in today's computational
world.
• Different tree data structures allow quicker and easier access to the data as it is a non-linear data
structure.
72. Tree Terminology
Node
• A node is an entity that contains a
key or value and pointers to its
child nodes.
• The last nodes of each path are
called leaf nodes or external
nodes that do not contain a
link/pointer to child nodes.
• The node having at least a child
node is called an internal node.
Edge
It is the link between any two nodes.
73. Cond...
Root
It is the topmost node of a tree.
Height of a Node
The height of a node is the number of edges from the node to the deepest leaf (ie. the
longest path from the node to a leaf node).
Depth of a Node
The depth of a node is the number of edges from the root to the node.
74. Height of a tree
The height of a Tree is the height of
the root node or the depth of the
deepest node.
76. Binary Tree
A binary tree is a tree data structure in
which each parent node can have at
most two children.
For example: In the image below, each
element has at most two children.
77. Types of
Binary Tree
Full Binary Tree
A full Binary tree is a special
type of binary tree in which
every parent node / internal
node has either two or no
children.
78. Perfect Binary Tree
A perfect binary tree is a type of binary
tree in which every internal node has
exactly two child nodes and all the leaf
nodes are at the same level.
79. Complete Binary Tree
• A complete binary tree is just like a
full binary tree, but with two major
differences
• Every level must be completely filled
• All the leaf elements must lean
towards the left.
• The last leaf element might not have
a right sibling i.e. a complete binary
tree doesn't have to be a full binary
tree.
81. Skewed Binary
Tree
A skewed binary tree is a
pathological/degenerate tree in which the
tree is either dominated by the left nodes or
the right nodes. Thus, there are two types of
skewed binary tree: left-skewed binary
tree and right-skewed binary tree.
82. Binary
Tree Representation Code :
struct node
{
int data;
struct node *left;
struct node *right;
};
A node of a binary tree is
represented by a structure
containing a data part and
two pointers to other
structures of the same type.
84. Binary Tree
Applications
• To easy and quick access to data
• In router algorithms
• To implement the Heap data
structures
85. Binary Search
tree
Binary search tree is a
data structure that
quickly allows us to
maintain a sorted list of
numbers.
It is called a binary tree
because each tree node
has maximum of two
children.
It is called a search tree
because it can be used
to search for the
presence of a number
in O(log(n)) time.
The properties that
separates a binary
search tree from a
regular binary tree is
All nodes of left subtree
are less than root node
All nodes of right
subtree are more than
root node
Both subtrees of each
node are also BSTs i.e.
they have the above
two properties
86. Representation of
Binary tree
The binary tree on the right isn't a
binary search tree because the
right subtree of the node "3"
contains a value smaller that it.
87. AVL Tree
AVL tree is a self-balancing
binary search tree in which
each node maintains an
extra information called as
balance factor whose value
is either -1, 0 or +1.
AVL tree got its name after
its inventor Georgy
Adelson-Velssky and Landis.
88. Balance Factor
• Balance factor of a node in an AVL tree
is the difference between the height of
the left subtree and that of right subtree
of that node.
• Balance Factor = (Height of Left
Subtree - Height of Right Subtree) or
(Height of Right Subtree - Height of
Left Subtree)
• The self balancing property of an AVL
tree is maintained by the balance factor.
The value of balance factor should
always be -1, 0 or +1.
90. B -Tree
• B-tree is a special type of self-balancing search tree in which
each node can contain more than one key and can have more
than two children. It is a generalized form of the binary search
tree.
• It is also known as a height-balanced m-way tree.
91. Why B-Tree ?
The need for B-tree arose
with the rise in the need
for lesser time in
accessing the physical
storage media like a hard
disk. The secondary
storage devices are
slower with a larger
capacity. There was a
need for such types of
data structures that
minimize the disk
accesses.
Other data structures
such as a binary search
tree, avl tree, red-black
tree, etc can store only
one key in one node. If
you have to store a large
number of keys, then the
height of such trees
becomes very large and
the access time increases.
However, B-tree can store
many keys in a single
node and can have
multiple child nodes. This
decreases the height
significantly allowing
faster disk accesses.
95. What is an
Algorithm ?
In CS , programming, and math,
an algorithm is a sequence of
instructions where the main goal is
to solve a specific problem, perform
a certain action, or computation.
In some way, an algorithm is a very
clear specification for processing
data, for doing calculations, among
many other tasks.
98. 1.Linear Search
Linear search is used on a
collections of items.
It relies on the technique of
traversing a list from start to
end by exploring properties of
all the elements that are found
on the way.
For example, consider an array
of integers of size . You should
find the value 10
99. Binary Search
Binary search is an efficient algorithm for finding
an item from a sorted list of items.
It works by repeatedly dividing in half the portion
of the list that could contain the item, until you've
narrowed down the possible locations to just one.
100. Jump Search
Like Binary Search, Jump Search is a searching
algorithm for sorted arrays.
The basic idea is to check fewer elements (than linear
search) by jumping ahead by fixed steps or skipping
some elements in place of searching all elements.
101. Fibonacci Search
• Fibonacci Search is a comparison-based
technique that uses Fibonacci numbers to
search an element in a sorted array.
105. Insertion Sort
Insertion sort is a simple
sorting algorithm that works
similar to the way you sort
playing cards in your hands.
The array is virtually split into
a sorted and an unsorted
part.
Values from the unsorted
part are picked and placed at
the correct position in the
sorted part.
106. Merge Sort
Merge sort repeatedly
breaks down a list into
several sub lists until each
sub list consists of a single
element and merging those
sub lists in a manner that
results into a sorted list.
107. Selection Sort
Selection sort is an algorithm
that selects the smallest
element from an unsorted
list in each iteration and
places that element at the
beginning of the unsorted
list.
108. Bubble Sort
Bubble Sort is the
simplest sorting
algorithm that works by
repeatedly swapping the
adjacent elements if they are
in wrong order.
109. Quick Sort
It works by selecting a 'pivot'
element from the array and
partitioning the other
elements into two sub-arrays,
according to whether they
are less than or greater than
the pivot.
Sub arrays are then sorted
recursively.
110. Heap Sort
Heap sort is a comparison
based sorting technique
based on Binary Heap data
structure.
It is similar to selection sort
where we first find the
maximum element and place
the maximum element at the
end.
We repeat the same process
for the remaining elements.
111. Analysis
of Algorithm
• Analysis of the algorithm is the
process of analyzing the problem-
solving capability of the algorithm in
terms of the time and size.
• Time and performance are the main
concerns of analysis of algorithm.
112. Complexites
of an
Algorithm
• The complexity of an algorithm computes the
amount of time and spaces required by an
algorithm for an input of size (n).
• The time complexity and the space
complexity are the two complexities.
113. Time
Complexity
• The time complexity is defined as the
process of determining a formula for
total time required towards the
execution of that algorithm.
• This calculation is totally independent
of implementation and programming
language.
114. Space
Complexity
• Space complexity is defining as the
process of defining a formula for
prediction of how much memory
space is required for the successful
execution of the algorithm.
• The memory space is generally
considered as the primary memory.