DSA

Index

  • Theory
  • FAQs

A data structure is a way of organizing(defining, storing & retrieving) the data so that the data can be used efficiently.

You must about the data-structure before implementing in application to implement in a better and optimized way.

Note: This section is for

  1. Theoretical comparison
  2. Implementation of standard DS structures

(For Problem & Solution refer Competitive Programming section)

Topics :

  1. Introduction (& Brief Comparison)
    • Array vs Array-list
  2. Array & String
    1. Array: Way to declare
    2. Array: ways to copy
    3. Array: Advantages/Applications and disadvantages
  3. Stack[todo]
  4. Queue[todo]
  5. List & Linked-list
    1. Define the Structure and add element
    2. traversal
    3. Find loop
    4. reverse link-list
    5. Mid element
    6. Doubly Linked-list
  6. Tree
    1. Structure
    2. BST -Adding nodes
    3. Traversal
      1. DFS
        • In-order
        • Pre-Order
        • Post-Order
      2. BFS
  7. Map


List : Array Vs Linked List

Parameters of comparison :

  1. Speed of accessibility
    1. read/search
    2. insert/Delete – if tied to shifting other elements ,
  2. storage space required
ParameterArrayLinked List
StrategyStatic in nature (shortage or wastage of memory)dynamic in nature (grow and shrink at runtime as per need)
Access &TraversalFaster as index basedSlower as required traversal to the element,node by node
Insertion & RemovalRequire shifting (if middle element
is removed or added at middle)
Fastest Insertion and Deletion
Unit of storageUses dynamically allocated node to store data.
DefinitionCollection of Nodes

Frequently asked DS Question Solutions and Tips for optimization.

  1. Arrays Questions
    • Equilibrium Index of an array
    • Find row number of a binary matrix having maximum number of 1s
  2. Tree
    • Recursion
      1. Head recursion
      2. Tail recursion
      3. Tree recursion
  3. Utilities
    1. Occurrence of each element
      • Using additional DS i.e Map
      • Without using additional DS
    2. Max Length Sub-array
      • brute-force
      • hash-map
    3. convert character to upper case
    4. Matrix
      • properties of matrix
      • related to rows and columns
    5. Bit-wise Operation
      • Single iteration find non-duplicate(XOR)

MFA questions

Published by

Unknown's avatar

sevanand yadav

software engineer working as web developer having specialization in spring MVC with mysql,hibernate

Leave a comment