Tutorial Flashcards

1
Q

What is DS?

A
  1. It’s a way of storing and organizing data in a computer so that I can be used efficiently.
  2. Set of Algorithms which can be used in programming to organise the data in memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Types of DS?

A
Types of Data structure
1.Primitive DS
  -Primitive Data types such as int,char,double,float 
   which can hold a single value
2.Non primitive DS
  -Two types
    a)Linear Data structure
    b)Non-Linear Data Structure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Linear and Non-Linear Data structure?

A
  1. Linear Data structure
    - Arrangement of Data in a sequential order
    - Eg: Arrays,Stacks,Queues,etc
  2. Non-Linear Data structure
    - Arrangement of Data in a random order
    - Eg: Trees and Graphs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Data structures can also be classified as?

A

Data structures can also be classified as:

  1. Static data structure
    - The size is allocated during the compile time so the size is fixed
  2. Dynamic data structure
    - The size is allocated during the run time so the size is flexible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is ADT?

A
  1. Abstract Data type tells us what has to be done which is a blueprint and Data structures provides us how it has be done with the implementation
  2. Examples: Stack,Queues,Linked List,etc
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Advantages of DS?

A
  1. Efficiency
  2. Reusability
  3. Abstraction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is an Algorithm?

A

An algorithm is a process or a set of rules required to perform calculations or some other problem-solving operations especially by a computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Characteristics of an Algorithm

A

Characteristics of an Algorithm is

  1. Input
  2. Output
  3. Unambiguity-Clear and Simple
  4. Finiteness-Set of instructions must be limited
  5. Effectiveness-Should be effective
  6. Program independent-Should work on all platforms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Dataflow of an Algorithm

A

Problem-Identifying the problem,so that an algo can be created
|
Algorithm-Set of instructions to solve the problem
|
Input- Receiving the input
|
Processing Unit-Place where the algorithms and input work to bring a solution
|
Output- Receiving the output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why do we need Algorithms?

A
  1. Scalability-Large Algorithms can be scaled down to small-small steps
  2. Performance-These small-small steps makes solving the problem feasible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Importance of Algorithms?

A

Theoretical importance: When any real-world problem is given to us and we break the problem into small-small modules. To break down the problem, we should know all the theoretical aspects.
Practical importance: As we know that theory cannot be completed without the practical implementation. So, the importance of algorithm can be considered as both theoretical and practical.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Algorithm Analysis

A

The algorithm can be analyzed in two levels, i.e., first is before creating the algorithm, and second is after creating the algorithm.

  1. Priori Analysis-the theoretical analysis of an algorithm which is done before implementing the algorithm.
  2. Posterior Analysis-a practical analysis of an algorithm. The practical analysis is achieved by implementing the algorithm using any programming language. This analysis basically evaluate that how much running time and space taken by the algorithm.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Algorithm Complexity

A

1.Time complexity : Amount of time required to run an algorithm.Represented by big O notation.
The time complexity is mainly calculated by counting the number of steps to finish the execution.

2.Space complexity: Amount of space required to solve a problem and produce an output.Represented by big O notation.

Space complexity = Auxiliary space( The extra space required by the algorithm) + Input size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Asymptotic Notations

A
  1. Big oh Notation (O)-
    a) Worst case scenario
    b) Big O notation is an asymptotic notation that measures the performance of an algorithm by simply providing the order of growth of the function.
    c) Represents the Upper bound of an Algorithm
  2. Omega Notation (Ω)
    a) Best case scenario
    b) It measures the best amount of time an algorithm can possibly take to complete.It determines what is the fastest time that an algorithm can run.
    c) Represents the Lower bound of an Algorithm
  3. Theta Notation (θ)
    a) Average or Realistic case scenario
    b) Big theta is mainly used when the value of worst-case and the best-case is same.
    c) It is the formal way to express both the upper bound and lower bound of an algorithm running time.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Pointer

A

-Points the address of the value stored anywhere in the computer
-Obtaining the value stored in the pointer is known as dereferencing the Pointer
Pointer improves the performance for repetitive process such as:

Traversing String
Lookup Tables
Control Tables
Tree Structures

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Structure

A
  • Composite data type which is used to store grouped list of under one name in a block of memory.
  • Allows different variables to be accessed
  • It allows different variables to be accessed by using a single pointer to the structure.

Advantages

a) It can hold variables of different data types.
b) We can create objects containing different types of attributes.
c) It allows us to re-use the data layout across programs.
b) It is used to implement other data structures like linked lists, stacks, queues, trees, graphs etc.