Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
14 views

What Is Linear Data Structure

A linear data structure arranges data elements sequentially, with each element connected to the previous and next element, allowing traversal from beginning to end. Linked lists are an example of a linear data structure, storing data in nodes with a data element and pointer to the next node. Single linked lists allow creating and displaying a list. Asymptotic notations like Big-O and Omega describe how an algorithm's running time changes relative to its input. Big-O gives the worst-case upper bound and Omega the best-case lower bound, with examples like bubble sort's quadratic worst case and linear best case.

Uploaded by

Arijit Ghosh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

What Is Linear Data Structure

A linear data structure arranges data elements sequentially, with each element connected to the previous and next element, allowing traversal from beginning to end. Linked lists are an example of a linear data structure, storing data in nodes with a data element and pointer to the next node. Single linked lists allow creating and displaying a list. Asymptotic notations like Big-O and Omega describe how an algorithm's running time changes relative to its input. Big-O gives the worst-case upper bound and Omega the best-case lower bound, with examples like bubble sort's quadratic worst case and linear best case.

Uploaded by

Arijit Ghosh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.What is Linear Data Structure?

A Linear data structure have data elements arranged in sequential manner and each
member element is connected to its previous and next element. This connection helps
to traverse a linear data structure in a single level and in single run. Such data structures are
easy to implement because computer memory is arranged in a linear way.

2. Define Linked List.


Linked lists are the types linear data structure where the data is stored in the form of nodes
which consist of an element of data and a pointer. The use of the pointer is that it points or
directs to the node which is next to the element in the sequence. The data stored in a linked
list might be of any form, strings, numbers, or characters. Both sorted and unsorted data can
be stored in a linked list along with unique or duplicate elements.

3.Define various functions of Single Linked List.


Create and display

B. Describe Asymptotic Notations, Big – O and Omega, with examples.


Asymptotic Notations:-
Asymptotic notations are the mathematical notations used to describe the running time of an
algorithm when the input tends towards a particular value or a limiting value. For example: In
bubble sort, when the input array is already sorted, the time taken by the algorithm is linear
i.e, the best case. But, when the input array is in reverse condition, the algorithm takes the
maximum time (quadratic) to sort the elements i.e, the worst case. When the input array is
neither sorted nor in reverse order, then it takes average time. These durations are denoted
using asymptotic notations.
Big – O Notation:-
Big-O notation represents the upper bound of the running time of an algorithm. Thus, it gives the
worst-case complexity of an algorithm.

Asymptotic Analysis: Big-O notation

Big-O gives the upper bound of a function

O(g(n)) = { f(n): there exist positive constants c and n0

such that 0 ≤ f(n) ≤ cg(n) for all n ≥ n0 }

The above expression can be described as a function f(n) belongs to the set O(g(n)) if there exists a
positive constant c such that it lies between 0 and cg(n), for sufficiently large n.

For any value of n, the running time of an algorithm does not cross the time provided by O(g(n)).

Since it gives the worst-case running time of an algorithm, it is widely used to analyze an algorithm
as we are always interested in the worst-case scenario.
Omega Notation:-
Omega notation represents the lower bound of the running time of an algorithm. Thus, it provides
the best case complexity of an algorithm.

Asymptotic Analysis: Omega Notation

Omega gives the lower bound of a function

Ω(g(n)) = { f(n): there exist positive constants c and n0

such that 0 ≤ cg(n) ≤ f(n) for all n ≥ n0 }

The above expression can be described as a function f(n) belongs to the set Ω(g(n)) if there exists a
positive constant c such that it lies above cg(n), for sufficiently large n.

For any value of n, the minimum time required by the algorithm is given by Omega Ω(g(n)).

You might also like