Saturday, 22 October 2016

DataStructures And Algorithms

Data-structures and Algorithms are the 2 very important topics in Computer Science.
Both affect the memory usage(for data-structure) and CPU Time (algorithm that interacts with data-structure)
                 Sometimes we discover inverse relationship between memory usage and CPU Time.
Eg. Array and Doubly Linked List
Greater the memory used by Doubly Linked List faster is searching and deletion algorithm.
And opposite is true in case of Array.
  
What is Data-structure ? 
         It is a Container class that provides storage of data items and capabilities for storing and retrieving data items.
Eg.Array, Linked List, Stack. Queue etc.

What is Algorithm ?
It is a sequence of instructions that accomplishes a task in finite time frame.
         It receives zero or more input but produces at least one output.
Eg. Linear Search,Bubble Sort,Stack push and pop ,Queue push and delete 

Algorithm representation -
Algorithms are represented by java source code.
         Flowchart is a visual representation of algorithm.





No comments:

Post a Comment