Data structure 101
Ageda Overview Importance of data structures Types of Data Structure - Arrays - Lists - Stack - Queue - Tree - graph
Overview when you're using your favorite apps - You make friendship on facebook - You follow influencer on instagram - You get suggestion on google as you type - You can perform redo and undo as you write a document - You order the last item in the inventory while others trying to order it So here we see some DATA (wither we created it or it is already exist ) and we were able to perform OPERATIONS on top of it or get more info from it How all this is possible Very Fast and without problems every time All of this is powered by what so called data structure: its the way we store and organize specific data to perform specific operations efficiently
Importance of data structures Data structures provide a way to organize and manage data in such a way that it can be accessed and modified efficiently. The importance of data structures lies in their ability to optimize the performance of algorithms and operations performed on data. They come in different types, like arrays, lists, and trees, each with its own way of arranging data, By choosing the appropriate data structure for a particular problem or application, developers can significantly improve efficiency in terms of time and space complexity. Essentially, understanding and implementing efficient data structures can lead to faster algorithms, reduced resource consumption, and overall better-performing software systems.
Types of Data Structure 01 Array, List, Linked List, double linked List 02 Stack and Queue 03 04 Tree (binary, AVL, B) and graph(directed, undirected) Map, Set, Tuple, Heap, Matrix, Victor, etc…
Array Arrays are a collection of items stored at contiguous memory locations. Features Simplicity: Easy to understand and implement. Efficiency: Direct access to elements using indices. Limitations Fixed Size: Arrays have a predetermined size allocation is done at compile time. Index does not hold much info: what if you can specify Meaningful name for the item instead index number
List List uses array internally to solve the fixed memory allocation, and does reallocation under the hood Not good when you need to do a lot of insertion and deletion from the middle because of the shifting operation Linked List Another variant of lists, it uses pointers internally instead of array, are a sequence of elements where each element points to the next. Suitable when need insertion and deletion from the middle because it just change the pointer
Stack This data structure is needed when you want to achieve - Last In, First Out (LIFO) behavior Real-World Example: Imagine a stack of plates The last plate you put on top is the first one you take off. Operations available are: ● Push: Adds an item to the top of the stack. ● Pop: Removes the top item from the stack. Applications: Undo/redo fearure, Memory management, Expression evaluation, etc…
Queue This data structure is needed when you want to achieve - First In, First Out (FIFO) behavior Real-World Example: Consider a queue at a ticket counter. The first person in line is the first one to be served. Operations available are: ● Enqueue: Adds an item to the end of the queue. ● Dequeue: Removes the item from the front of the queue. Applications: Job scheduling, Batch Processing, Web servers, etc…
Tree Trees are hierarchical data structures consisting of nodes connected by edges. There are many types of tree: the most common ones are: Binary trees: a type of tree in which each node has at most two children Binary Search Trees: type of binary tree where the value of each node's left child is less than the value of the node, and the value of each node's right child is greater. Features: - Efficient Searching: BSTs enable efficient searching, insertion, and deletion operations. - In-order Traversal: Traversing a BST in-order yields elements in sorted order. Problems: sometimes insertion/deletion can lead to
Applications on Tree Suggestion as you type Database indexing Organization chart OS File System Web pages (Document Object Model)
Graphs Graph Data Structure is a collection of nodes connected by edges. It’s used to represent relationships between different entities. Graph algorithms are methods used to manipulate and analyze graphs, solving various problems like finding the shortest path or detecting cycles. Types of Graphs ● Directed Graphs (Digraphs) ● Undirected Graphs ● Weighted Graphs ● Tree is considered special type of graphs
Applications on Graphs Graphs are used to represent networks Social media platforms such as Facebook uses Undirected Graphs to represent connections like friendships. On the other hand instagram uses Directed Graphs to represent following.
Map Map is a data structure that stores a collection of key-value pairs, where each key is associated with a single value. it allows for efficient and fast lookups, inserts, and deletes. Types of Maps ● HashMap ● Linked Hash Map ● Tree Map
Thank you! Any Questions? Basheer Almomani Backend software engineer basheer.almomani94@gmail.com

common Data structure algorithms and application

  • 1.
  • 2.
    Ageda Overview Importance of datastructures Types of Data Structure - Arrays - Lists - Stack - Queue - Tree - graph
  • 3.
    Overview when you're usingyour favorite apps - You make friendship on facebook - You follow influencer on instagram - You get suggestion on google as you type - You can perform redo and undo as you write a document - You order the last item in the inventory while others trying to order it So here we see some DATA (wither we created it or it is already exist ) and we were able to perform OPERATIONS on top of it or get more info from it How all this is possible Very Fast and without problems every time All of this is powered by what so called data structure: its the way we store and organize specific data to perform specific operations efficiently
  • 4.
    Importance of datastructures Data structures provide a way to organize and manage data in such a way that it can be accessed and modified efficiently. The importance of data structures lies in their ability to optimize the performance of algorithms and operations performed on data. They come in different types, like arrays, lists, and trees, each with its own way of arranging data, By choosing the appropriate data structure for a particular problem or application, developers can significantly improve efficiency in terms of time and space complexity. Essentially, understanding and implementing efficient data structures can lead to faster algorithms, reduced resource consumption, and overall better-performing software systems.
  • 5.
    Types of DataStructure 01 Array, List, Linked List, double linked List 02 Stack and Queue 03 04 Tree (binary, AVL, B) and graph(directed, undirected) Map, Set, Tuple, Heap, Matrix, Victor, etc…
  • 6.
    Array Arrays are acollection of items stored at contiguous memory locations. Features Simplicity: Easy to understand and implement. Efficiency: Direct access to elements using indices. Limitations Fixed Size: Arrays have a predetermined size allocation is done at compile time. Index does not hold much info: what if you can specify Meaningful name for the item instead index number
  • 7.
    List List uses arrayinternally to solve the fixed memory allocation, and does reallocation under the hood Not good when you need to do a lot of insertion and deletion from the middle because of the shifting operation Linked List Another variant of lists, it uses pointers internally instead of array, are a sequence of elements where each element points to the next. Suitable when need insertion and deletion from the middle because it just change the pointer
  • 8.
    Stack This data structureis needed when you want to achieve - Last In, First Out (LIFO) behavior Real-World Example: Imagine a stack of plates The last plate you put on top is the first one you take off. Operations available are: ● Push: Adds an item to the top of the stack. ● Pop: Removes the top item from the stack. Applications: Undo/redo fearure, Memory management, Expression evaluation, etc…
  • 9.
    Queue This data structureis needed when you want to achieve - First In, First Out (FIFO) behavior Real-World Example: Consider a queue at a ticket counter. The first person in line is the first one to be served. Operations available are: ● Enqueue: Adds an item to the end of the queue. ● Dequeue: Removes the item from the front of the queue. Applications: Job scheduling, Batch Processing, Web servers, etc…
  • 10.
    Tree Trees are hierarchicaldata structures consisting of nodes connected by edges. There are many types of tree: the most common ones are: Binary trees: a type of tree in which each node has at most two children Binary Search Trees: type of binary tree where the value of each node's left child is less than the value of the node, and the value of each node's right child is greater. Features: - Efficient Searching: BSTs enable efficient searching, insertion, and deletion operations. - In-order Traversal: Traversing a BST in-order yields elements in sorted order. Problems: sometimes insertion/deletion can lead to
  • 11.
    Applications on Tree Suggestion asyou type Database indexing Organization chart OS File System Web pages (Document Object Model)
  • 12.
    Graphs Graph Data Structureis a collection of nodes connected by edges. It’s used to represent relationships between different entities. Graph algorithms are methods used to manipulate and analyze graphs, solving various problems like finding the shortest path or detecting cycles. Types of Graphs ● Directed Graphs (Digraphs) ● Undirected Graphs ● Weighted Graphs ● Tree is considered special type of graphs
  • 13.
    Applications on Graphs Graphs areused to represent networks Social media platforms such as Facebook uses Undirected Graphs to represent connections like friendships. On the other hand instagram uses Directed Graphs to represent following.
  • 14.
    Map Map is adata structure that stores a collection of key-value pairs, where each key is associated with a single value. it allows for efficient and fast lookups, inserts, and deletes. Types of Maps ● HashMap ● Linked Hash Map ● Tree Map
  • 15.
    Thank you! Any Questions? BasheerAlmomani Backend software engineer basheer.almomani94@gmail.com

Editor's Notes

  • #3 so you know when you're using your favorite apps and everything just seems to work smoothly? Like when you're on Facebook and instantly connect with friends, or on Instagram following your favorite influencers hassle-free? Well, that's all thanks to something called data structures. Think of data structures as the secret sauce behind the scenes. They're like the organized drawers in your desk where you keep different things. When you want to find something quickly, you know exactly which drawer to open. So, when you're scrolling through Google and it's predicting what you're searching for before you even finish typing, or when you're writing a document and can undo or redo your changes effortlessly, it's because the data you're working with is neatly organized and ready to be used at lightning speed.