Advantage: The problem of primary clustering is eliminated.
Disadvantage: There is no guarantee of finding an unoccupied cell once the table is nearly half full.
Posted Date:- 2021-09-13 05:47:05
<> Maintaining a set of connected components of a graph.
<> Maintain list of duplicate copies of web pages.
<> Constructing a minimum spanning tree for a graph.
Posted Date:- 2021-09-13 05:46:30
A collection of non-empty disjoint sets S=S1,S2,….,Sk i.e;each Si is a non-empty set that has no element in common with any other Sj. In mathematical notation this is: Si∩Sj=Ф. Each set is identified by a unique element called its representative.
Posted Date:- 2021-09-13 05:45:32
In a directed graph, for any node v, the number of edges which have v as their terminal node is called the indegree of the node v.
Posted Date:- 2021-09-13 05:44:44
A simple diagram which does not have any cycles is called an acyclic graph.
Posted Date:- 2021-09-13 05:44:04
An undirected graph is connected, if there is a path from every vertex to every other vertex. A directed graph with this property is called strongly connected.
Posted Date:- 2021-09-13 05:43:12
When a directed graph is not strongly connected but the underlying graph is connected, then the graph is said to be weakly connected.
Posted Date:- 2021-09-13 05:42:38
Traversing a graph is an efficient way to visit each vertex and edge exactly once.
Posted Date:- 2021-09-13 05:42:05
Actually macro and function are used for different purposes. A macro replaces its expression code physically in the code at the time of preprocessing. But in case of function the control goes to the function while executing the code. So when the code is small then it is better to use macro. But when code is large then function should be used.
Posted Date:- 2021-09-13 05:40:08
i) If path exists from one node to another node, walk across the edge – exploring the edge.
ii) If path does not exist from one specific node to any other node, return to the previous node where we have been before – backtracking.
Posted Date:- 2021-09-13 05:39:26
A connected graph G is said to be biconnected, if it remains connected after removal of any one vertex and the edges that are incident upon that vertex. A connected graph is biconnected, if it has no articulation points.
Posted Date:- 2021-09-13 05:38:54
A path having minimum weight between two vertices is known as shortest path, in which weight is always a positive number.
Posted Date:- 2021-09-13 05:38:25
<> It is the mathematical way of representing the expression.
<> It is easier to see visually which operation is done from first to last.
Posted Date:- 2021-09-13 05:37:43
The basic operations that can be performed on a stack are
Push operation.
Pop operation.
Peek operation.
Empty check.
Fully occupied check.
Posted Date:- 2021-09-13 05:37:04
1. It is not necessary to specify the number of elements in a linked list during its declaration.
2. Linked list can grow and shrink in size depending upon the insertion and deletion that occurs in the list.
3. Insertions and deletions at any place in a list can be handled easily and efficiently.
4. A linked list does not waste any memory space.
Posted Date:- 2021-09-13 05:35:26
Some of the static data structures in C are arrays, pointers, structures etc.
Posted Date:- 2021-09-13 05:33:15
A memory leak occurs when a program loses the ability to free a block of dynamically allocated memory.
Posted Date:- 2021-09-13 05:31:50
The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type.
Posted Date:- 2021-09-13 05:30:56
Precision refers the accuracy of the decimal portion of a value. Precision is the number of digits allowed after the decimal point.
Posted Date:- 2021-09-13 05:29:47
Enqueue is the process that places data at the back of the queue.
Posted Date:- 2021-09-13 05:28:13
The isEmpty() member method is called within the dequeue process to determine if there is an item in the queue to be removed i.e. isEmpty() is called to decide whether the queue has at least one element. This method is called by the dequeue() method before returning the front element.
Posted Date:- 2021-09-13 05:27:47
The appendNode() member function places a new node at the end of the linked list. The appendNode() requires an integer representing the current data of the node.
Posted Date:- 2021-09-13 05:27:21
. RDBMS Array (i.e. Array of structures)
. Network data model Graph
. Hierarchical data model Trees.
Posted Date:- 2021-09-13 05:26:36
malloc: allocate n bytes.
calloc: allocate m times n bytes initialized to 0.
Posted Date:- 2021-09-13 05:25:32
No! Minimal spanning tree assures that the total weight of the tree is kept at its minimum. But it doesn’t mean that the distance between any two nodes involved in the minimal-spanning tree is minimum.
Posted Date:- 2021-09-13 05:24:13
A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized.
Posted Date:- 2021-09-13 05:23:45
B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This corresponds to the records that shall be stored in leaf nodes.
Posted Date:- 2021-09-13 05:22:32
In general: There are 2n-1 nodes in a full binary tree. By the method of elimination:
Full binary trees contain odd number of nodes. So there cannot be full binary trees with 8 or 14 nodes, so rejected. With 13 nodes you can form a complete binary tree but not a full binary tree. So the correct answer is 15.
Posted Date:- 2021-09-13 05:21:59
The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type.
Posted Date:- 2021-09-13 05:21:22
RDBMS – Array (i.e. Array of structures)
Network data model – Graph
Hierarchical data model – Trees
Posted Date:- 2021-09-13 05:20:39
Parenthesis is not required because the order of the operators in the postfix /prefix expressions determines the actual order of operations in evaluating the expression.
Posted Date:- 2021-09-13 05:20:08
i) We can’t traverse the list backward.
ii) If a pointer to a node is given we cannot delete the node.
Posted Date:- 2021-09-13 05:19:38
Using Floyd's cycle-finding Algorithm
Using hashing
Using the visited nodes method
Posted Date:- 2021-09-13 05:16:54
As the name suggests, the queue is used whenever you need to manage a group of objects in the order FIFO. A few of the queue data structure applications are listed below:
1. Serving requests on a single shared resource, like CPU task scheduling, printer, etc.
2. Handling interruptions in real-time systems.
3. Buffers in apps like CD player and MP3 media players
4. In maintaining a playlist in media players, like adding or removing songs.
Posted Date:- 2021-09-13 05:15:11
It depends on where you plan to use Linked lists. You can consider a linked list for both non-linear and linear data structures. When used for data storage, it is regarded as a non-linear data structure. When used for access strategies, it is considered a linear data structure.
Posted Date:- 2021-09-13 05:14:07
A linked list is a series of data structures connected via links. In simple words, it's a sequence of links that contain items. After the array, the linked list is the second most used data structure. The essential terms to understand the linked list are:
Link - In a linked list, each link stores data called an element.
Next - In a linked list, each link is connected to the following link called next.
LinkedList - It contains the connection link to the first link called first.
Basic operations supported by a linked list:
Insertion - Inserts an element at the list beginning.
Deletion - Deletes an element at the list beginning.
Display - Displays the complete list.
Search - Searches an element using the given key.
Delete - Deletes an element using the given key.
Posted Date:- 2021-09-13 05:13:45
Mainly the following operations are performed on a stack:
1. Push operation: To add an item to the stack. If the stack is complete, then it is in an overflow condition.
2. Pop operation: It is used to remove an item from the stack. If it's an empty stack, then it is in underflow condition.
3. isEmpty operation: If the stack is empty returns true, else false.
4. Peek or Top operation: This returns the top element of the stack.
Posted Date:- 2021-09-13 05:12:41
The main difference between storage structure and file structure depends on the memory area that is accessed.
Storage structure: It's a data structure representation in computer memory.
File structure: It's a storage structure representation in the auxiliary memory.
Posted Date:- 2021-09-13 05:11:03
To implement the LRU cache, you should use two data structures: a hashmap and a doubly linked list.
A hashmap helps with the lookup of cached keys, and a doubly-linked list helps maintain the eviction order.
Posted Date:- 2021-09-13 05:10:26
Using two stacks, you can implement a queue. The purpose is to complete the queue's en queue operation so that the initially entered element always ends up at the top of the stack.
1. First, to enqueue an item into the queue, migrate all the elements from the beginning stack to the second stack, push the item into the stack, and send all elements back to the first stack.
2. To dequeue an item from the queue, return the top item from the first stack.
Posted Date:- 2021-09-13 05:07:14
Yes, you can implement a stack using two queues. Any data structure to act like a stack should have a push() method to add data on top and a pop() method to remove the top data.
Posted Date:- 2021-09-13 05:06:30
The minimum number of queues that are needed is two. Out of which, one queue is intended for sorting priorities and the other queue is meant for the actual storage of data.
Posted Date:- 2021-09-13 05:05:45
A binary tree is allowed or can have a minimum of zero nodes. Further, a binary tree can also have 1 or 2 nodes.
Posted Date:- 2021-09-13 05:05:07
The following are the steps that you need to follow to insert the data into the tree:
1. First of all, check whether the data is unique or not ( i.e. check whether the data that you are going to insert doesn’t already exist in the tree).
2. Then check if the tree is empty. If the tree is empty then all you need to do is just insert a new item into the root. If the key is smaller than that of a root’s key then insert that data into the root’s left subtree or otherwise, insert the data into the right side of the root’s subtree.
Posted Date:- 2021-09-13 05:03:22
There are six types of tree given as follows.
1) General Tree
2) Forests
3) Binary Search Tree
4) Tournament Tree
5) Binary Tree
6) Expression Tree
Posted Date:- 2021-09-13 05:01:37
A spanning tree is a subset of a graph that has all the vertices but with the minimum number of edges necessary.
The maximum number of spanning tree a graph have depend on the way the graph is linked. A complete undirected graph containing n number of nodes may have a maximum of nn-1 number of spanning trees.
Posted Date:- 2021-09-13 05:00:19
There are 3 widely used approaches to develop the algorithms-
Greedy approach − Seeking a solution by picking the next best possible alternative.
Divide and conquer − Bringing the problem to a minimal feasible sub-problem and separately solving it.
Dynamic programming − Bringing the problem to a minimal possible sub-problems and solve them together.
Posted Date:- 2021-09-13 04:57:40
A queue is a type of linear structure which is used to access components that support the FIFO (First In First Out) method. Dequeue, enqueue, front, and rear are key queue functions. Unlike a stack, the arrays and linked lists are used to enforce a queue.
The element most recently added is removed first in a stack. However, in the event of a queue, the element least recently added is removed first.
Posted Date:- 2021-09-13 04:57:01
Stack is a linear data structure to access components that implement either LIFO (Last In First Out) or FILO (First In Last Out) method. The common functions of a stack are push, pop, and peek.
Posted Date:- 2021-09-13 04:56:40
Following are the different operation that are generally carried out in Data Structures:
Insert– Add a new data item in the already existing set of data items.
Delete– Remove an existing data item from the given data item set.
Traverse– Access each piece of data precisely once so that it can be processed.
Search– Figure out where the data item resides in the specified data item set.
Sort– Arrange the data objects in certain order i.e. in ascending or descending order for numerical data and in dictionary order for alphanumeric data.
Posted Date:- 2021-09-13 04:56:03