Worksheet On Data Structure
Worksheet On Data Structure
When we want to insert items in the middle of the list, such as when implementing a priority
queue
Some scenarios in which we use array over the linked list are:
When we know the number of elements in the array beforehand, so we can allocate the
correct amount of memory
When we need speed when iterating through all the elements in the sequence
When memory is a concern; filled arrays use less memory than linked lists, as each element in
the array is the data but each linked list node requires the data as well as one or more pointers
to the other elements in the linked list
2. What is an algorithm?
An algorithm is a step by step method of solving a problem or manipulating data. It defines a set
of instructions to be executed in a certain order to get the desired output.
What Is Hashing?
Answer :
Hashing is a technique to convert a range of key values into a range of indexes of an array. By
using hash tables, we can create an associative data storage where data index can be find by
providing its key values.
What Is The Prefix And Post Fix Notation Of (a + B) * (c + D) ?
Answer :
Prefix Notation − * + a b + c d
Postfix Notation − a b + c d + *
What is a stack?
A stack is an abstract data type that specifies a linear data structure, as in a real physical stack or
piles where you can only take the top item off the stack in order to remove things. Thus, insertion
(push) and deletion (pop) of items take place only at one end called top of the stack, with a
particular order: LIFO (Last In First Out) or FILO (First In Last Out).
Syntax parsing
String reversal
Parenthesis checking
Backtracking
Expression evaluation
Backtracking
Memory management
A postfix expression is made up of operators and operands, with the operator coming after the
operands. That is, in a postfix expression, the operator comes after the operands. Likewise, what
is the proper postfix form? The correct postfix phrase is A B + C *.
As waiting lists for a single shared resource in a printer, CPU, call center systems, or image
uploads; where the first one entered is the first to be processed
In the asynchronous transfer of data; or example pipes, file IO, and sockets
To maintain the playlist in media players (to add or remove the songs)
The front is used to get the value of the first data item but does not remove it
QuickSort algorithm is generally considered the fastest because it has the best performance for
most inputs.
Merge sort is a divide-and-conquer algorithm for sorting the data. It works by merging and
sorting adjacent data to create bigger sorted lists, which are then merged recursively to form even
bigger sorted lists until you have one single sorted list.
Define the graph Data Structure?
It is a type of non-linear data structure that consists of vertices or nodes connected by edges or
arcs to enable storage or retrieval of data. Edges may be directed or undirected.
Transport grids where stations are represented as vertices and routes as the edges of the graph
Utility graphs of power or water, where vertices are connection points and edge the wires or
pipes connecting them
Social network graphs to determine the flow of information and hotspots (edges and vertices)
Neural networks where vertices represent neurons and edge the synapses between them
Data structure interview questions like this are very common and frequently asked
A tree is referred to as a generic tree if its hierarchy is not constrained. In the General Tree, each
node can have an endless number of offspring, and all other trees are subsets of the tree.
The binary tree is a type of tree in which each parent has at least two offspring. The children are
referred to as the left and right youngsters. This tree is more popular than most others. When
specific limitations and features are given to a Binary tree, various trees such as AVL tree, BST
(Binary Search Tree), RBT tree, and so on are also utilized.
Binary Search Tree (BST) is a binary tree extension that includes numerous optional constraints.
In BST, a node's left child value should be less than or equal to the parent value, while the
correct child value should always be higher than or equal to the parent's value.
A binary tree is a tree data structure made up of nodes, each of which has two offspring, known
as the left and right nodes. The tree begins with a single node called the root.
Each node in the tree carries the following information:
Data
Application of Queues
processes