0% found this document useful (0 votes)
208 views7 pages

Data Structure Assignment

Representatives answer customer questions, help resolve problems, process refunds and make suggestions regarding the purchase of additional products and services. Customer service representatives work directly with customers and clients of all kinds of businesses. As the job title suggests, these workers represent their employer in dealings with customers and clients. Typical job responsibilities include: Communicating with clients and customers about their experiences with a product or service

Uploaded by

Nedved Rich
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
208 views7 pages

Data Structure Assignment

Representatives answer customer questions, help resolve problems, process refunds and make suggestions regarding the purchase of additional products and services. Customer service representatives work directly with customers and clients of all kinds of businesses. As the job title suggests, these workers represent their employer in dealings with customers and clients. Typical job responsibilities include: Communicating with clients and customers about their experiences with a product or service

Uploaded by

Nedved Rich
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Q.

5 (i) LIST THE VARIOURS TYPES OF LINKED LIST AND BRIEFLY


EXPLAIN EACH ONE OF THEM
i. Singly linked list: In singly linked list, all nodes are arranged sequentially
by linking with a pointer. It has only head part and corresponding references
to the next nodes.
ii. Doubly linked list: A doubly linked list is one in which all nodes are linked
together by multiple links which help in accessing both the successor (next)
and predecessor (previous) node for any arbitrary node within the list.
iii. Circular linked list: A circular linked list is one, which has no beginning
and no end. Thus, it is basically a singly linked list by storing the address of
the very first node in the linked field of the last node.

(ii).PROVIDE ONE APPLICATION AREA OF A LINKED LIST


1.Singly Linked List: This Linked list is unidirectional,
which will start from the head and end up with a tail
containing data and pointer to the next node in a

particular node.

 Applications of Singly Linked List are as following:


1.It is used to implement stacks and queues which are like
fundamental needs throughout computer science.
2.To prevent the collision between the data in the hash map, we
use a singly linked list.
3.If we ever noticed the functioning of a casual notepad, it also uses
a singly linked list to perform undo or redo or deleting functions.
4.We can think of its use in a photo viewer for having look at photos
continuously in a slide show.
5.In the system of train, the idea is like a singly linked list, as if you
want to add a Boggier, either you have to take a new bogie to
add at last or you must spot a place in between bogies and add
it.
Q.6 BRIEFLY EXPLAIN THE FOLLOWING
(i).linear search:Linear search is a very simple search algorithm. In this
type of search, a sequential search is made over all items one by one. Every
item is checked and if a match is found then that particular item is returned,
otherwise the search continues till the end of the data collection.

(ii).Binary search:Binary search is an efficient algorithm for finding an item


from a sorted list of items. It works by repeatedly dividing in half the portion of
the list that could contain the item, until you've narrowed down the possible
locations to just one. We used binary search in the guessing game in the
introductory tutorial.

(iii).Selection Sort:Selection sort is a simple sorting algorithm. This sorting


algorithm is an in-place comparison-based algorithm in which the list is
divided into two parts, the sorted part at the left end and the unsorted part at
the right end. Initially, the sorted part is empty and the unsorted part is the
entire list.

(iv).Bubble Sort:Bubble Sort is comparison based sorting algorithm. In this


algorithm adjacent elements are compared and swapped to make correct
sequence. This algorithm is simpler than other algorithms, but it has some
drawbacks also. This algorithm is not suitable for large number of data set.

Q.7 DISCUSS THE FOLLOWING


(i).A TREE:Tree represents the nodes connected by edges. A binary tree has
a special condition that each node can have a maximum of two children. A
binary tree has the benefits of both an ordered array and a linked list as
search is as quick as in a sorted array and insertion or deletion operation are
as fast as in linked list.

(ii).Binary Tree:A binary tree has a special condition that each node can
have a maximum of two children. ... A binary tree has the benefits of both an
ordered array and a linked list as search is as quick as in a sorted array and
insertion or deletion operation are as fast as in linked list.

(iii).Tower of Hanoi:Tower of Hanoi consists of three pegs or towers with n


disks placed one over the other. The objective of the puzzle is to move the
stack to another peg following these simple rules. Only one disk can be
moved at a time. No disk can be placed on top of the smaller disk.

(iv).Hashing:A hashing algorithm is a mathematical algorithm that converts


an input data array of a certain type and arbitrary length to an output bit string
of a fixed length. Hashing algorithms take any input and convert it to a uniform
message by using a hashing table.
Q.8 EXPLAIN THE FOLLOWING TERMS AS IN DATA
STRUCTURE:INTERFACE AND IMPLEMENTATION
An interface, sometimes also called an abstract data type, defines the set of
operations supported by a data structure and the semantics, or meaning, of
those operations. An interface tells us nothing about how the data structure
implements these operations, it only provides the list of supported
operations along with specifications about what types of arguments each
operation accepts and the value returned by each operation.

A data structure implementation on the other hand, includes the internal


representation of the data structure as well as the definitions of the
algorithms that implement the operations supported by the data structure.
Thus, there can be many implementations of a single interface. For example,
in , we will see implementations of the List interface using arrays and in we
will see implementations of the List interface using pointer-based data
structures. Each implements the same interface, List, but in different ways.

Q.9.EXPLAIN THE THREE TYPES OF CASES WHICH


ARE USUALLY USED TO COMPARE THE VARIOUS
DATA STRUCTURES EXCRUTION TIME IN ARELATIVE
MANNER.

1.Worst Case − This is the scenario where a particular data structure


operation takes maximum time it can take. If an operation's worst case time is
ƒ(n) then this operation will not take more than ƒ(n) time where ƒ(n)
represents function of n.

2.Average Case − This is the scenario depicting the average execution time
of an operation of a data structure. If an operation takes ƒ(n) time in
execution, then m operations will take mƒ(n) time.

3.Best Case − This is the scenario depicting the least possible execution
time of an operation of a data structure. If an operation takes ƒ(n) time in
execution, then the actual operation may take time as the random number
which would be maximum as ƒ(n).
Q.10.DISCUSS THREE CHARACTERISTICS OF DATA
STRUCTURE.
1.Linear or non-linear: This characteristic describes whether the
data items are arranged in sequential order, such as with an array, or
in an unordered sequence, such as with a graph.
2.Homogeneous or heterogeneous: This characteristic describes
whether all data items in a given repository are of the same type.
One example is a collection of elements in an array, or of various
types, such as an abstract data type defined as a structure in C or a
class specification in Java.
3.Static or dynamic: This characteristic describes how the data
structures are compiled. Static data structures have fixed sizes,
structures and memory locations at compile time. Dynamic data
structures have sizes, structures and memory locations that can
shrink or expand, depending on the use.

Q.11.WHAT ARE ASYMPTOTIC NOTATION.


Asymptotic notation describes the algorithm efficiency and performance in a
meaningful way. It describes the behaviour of time or space complexity for
large instance characteristics.

Q.12,WHY WE NEED TO DO ALGORITHM ANALYSIS?


Algorithm analysis is important in practice because the accidental or
unintentional use of an inefficient algorithm can significantly impact system
performance. In time-sensitive applications, an algorithm taking too long to
run can render its results outdated or useless. An inefficient algorithm can
also end up requiring an uneconomical amount of computing power or storage
in order to run, again rendering it practically useless.Analysis of algorithms
typically focuses on the asymptotic performance, particularly at the
elementary level, but in practical applications constant factors are important,
and real-world data is in practice always limited in size.
Q.13.WHAT IS THE MEANING OF EFFIENCY OF AN
ALGORITHM

Efficiency of an algorithm is defined as the number of computational


resources used by the algorithm. An algorithm must be analyzed to
determine its resource usage. The efficiency of an algorithm can be
measured based on the usage of different resources.

Q.14.EXPLAIN ANY THREE CHARACTERISTICS OF


AN ALGORITHM

 Input − An algorithm should have 0 or more well-defined inputs.


 Output − An algorithm should have 1 or more well-defined outputs,
and should match the desired output.
 Finiteness − Algorithms must terminate after a finite number of steps.

DATA STRUCTURE ASSIGNMENT


NAME:SARPONG RICHARD
INDEX NUMBER:06201219
GROUP:ICT 2B
Q.1.DISTINGUISH BETWEEN AN ARRAY AND A
LINKED LIST
Array Linked list

An array is a collection of elements of a similar A linked list is a collection of objects kno


data type. node where node consists of two parts, i
and address.

Array elements store in a contiguous memory Linked list elements can be stored anywher
location. memory or randomly stored.

Array works with a static memory. Here static The Linked list works with dynamic memor
memory means that the memory size is fixed and dynamic memory means that the memory
cannot be changed at the run time. be changed at the run time according
requirements.

Array elements are independent of each other. Linked list elements are dependent on eac
As each node contains the address of t
node so to access the next node, we n
access its previous node.

Array takes more time while performing any Linked list takes less time while perform
operation like insertion, deletion, etc. operation like insertion, deletion, etc.

Accessing any element in an array is faster as the Accessing an element in a linked list is slow
element in an array can be directly accessed starts traversing from the first element
through the index. linked list.

In the case of an array, memory is allocated at In the case of a linked list, memory is alloc
compile-time. run time.

Memory utilization is inefficient in the array. For Memory utilization is efficient in the ca
example, if the size of the array is 6, and array linked list as the memory can be allocated
consists of 3 elements only then the rest of the located at the run time according
space will be unused. requirement.

Q.2.EXPLAIN THE TERM NODE AS IN LINKED


LIST.

A node is a collection of two sub-elements or parts. A data part that stores


the element and a next part that stores the link to the next node. Linked List:
A linked list is formed when many such nodes are linked together to form a
chain. Each node points to the next node present in the order.

Q.3.i CONVERT THE INFIX EXPRESSION INTO


ITS EQUIVALENT POSTFIX EXPRESSION

=ABD+*E/F-GHK/+-

You might also like