Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
List some applications of queue data structure.
Applications of the queue are given as follows: Queues are widely used as waiting lists for a single shared resource like a printer, disk, or CPU. Queues are used in the asynchronous transfer of data (where data is not being transferred at the same rate between two processes) for eg. pipes, file IO,Read more
Applications of the queue are given as follows:
What are the applications of data structures?
Some practical applications of data structures are: Storing data in a tabular form. For example, the contact details of an individual can be stored in arrays. Arrays are widely used in image processing and speech processing. Music players and image sliders use linked lists to switch between items. ARead more
Some practical applications of data structures are:
Write the C program to insert a node in circular singly list at the beginning.
#include<stdio.h> #include<stdlib.h> void beg_insert(int); struct node { int data; struct node *next; }; struct node *head; void main () { int choice,item; do { printf("\nEnter the item which you want to insert?\n"); scanf("%d",&item); beg_Read more
See lessHow do you reference all the elements in a one-dimension array?
We can reference all the elements in a one-dimension array using an indexed loop. The counter runs from 0 to the maximum array size, say n, minus one. All elements of the one-dimension array are referenced in sequence by using the loop counter as the array subscript.
We can reference all the elements in a one-dimension array using an indexed loop. The counter runs from 0 to the maximum array size, say n, minus one. All elements of the one-dimension array are referenced in sequence by using the loop counter as the array subscript.
See lessWhat is the difference between file structure and storage structure?
File Structure: A hard disk or external device (such as a USB), stores data that remains intact till manually deleted. Such data representation into secondary or auxiliary memory is called a file structure. Storage Structure: In this type of structure, data (variables, constants, etc.) are stored inRead more
How do you distinguish between NumPy and SciPy?
Typically, NumPy contains nothing but the array data type and the most basic operations, such as basic element-wise functions, indexing, reshaping, and sorting. All the numerical code resides in SciPy. As one of NumPy’s most important goals is compatibility, the library tries to retain all featuresRead more
Typically, NumPy contains nothing but the array data type and the most basic operations, such as basic element-wise functions, indexing, reshaping, and sorting. All the numerical code resides in SciPy.
As one of NumPy’s most important goals is compatibility, the library tries to retain all features supported by either of its predecessors. Hence, NumPy contains a few linear algebra functions despite the fact that these more appropriately belong to the SciPy library.
SciPy contains fully-featured versions of the linear algebra modules available to NumPy in addition to several other numerical algorithms.
See lessWrite the steps involved in the insertion and deletion of an element in the stack.
Push: Increment the variable top so that it can refer to the next memory allocation Copy the item to at the array index value equal to the top Repeat steps 1 and 2 until the stack overflows Pop: Store the topmost element into the another variable Decrement the value of the top Return the topmost eleRead more
Push:
Pop:
What is a postfix expression?
An expression in which operators follow the operands is known as postfix expression. The main benefit of this form is that there is no need to group sub-expressions in parentheses or to consider operator precedence. The expression "a + b" will be represented as "ab+" in postfix notation.
An expression in which operators follow the operands is known as postfix expression. The main benefit of this form is that there is no need to group sub-expressions in parentheses or to consider operator precedence.
The expression “a + b” will be represented as “ab+” in postfix notation.
See lessHow to reference all the elements in a one-dimension array?
It can be done by using an indexed loop such that the counter runs from 0 to the array size minus one. In this manner, you can reference all the elements in sequence by using the loop counter as the array subscript.
It can be done by using an indexed loop such that the counter runs from 0 to the array size minus one. In this manner, you can reference all the elements in sequence by using the loop counter as the array subscript.
See lessHow are the elements of a 2D array are stored in the memory?
There are two techniques by using which, the elements of a 2D array can be stored in the memory. Row-Major Order: In row-major ordering, all the rows of the 2D array are stored in the memory contiguously. First, the 1st row of the array is stored in the memory completely, then the 2nd row of the arrRead more
There are two techniques by using which, the elements of a 2D array can be stored in the memory.
Calculate the address of a random element present in a 2D array, given base address as BA.
Row-Major Order: If the array is declared as a[m][n] where m is the number of rows while n is the number of columns, then the address of an element a[i][j] of the array stored in row-major order is calculated as, Address(a[i][j]) = B. A. + (i * n + j) * size Column-Major Order: If the array iRead more
Row-Major Order: If the array is declared as a[m][n] where m is the number of rows while n is the number of columns, then the address of an element a[i][j] of the array stored in row-major order is calculated as,
Address(a[i][j]) = B. A. + (i * n + j) * size
Column-Major Order: If the array is declared as a[m][n] where m is the number of rows while n is the number of columns, then the address of an element a[i][j] of the array stored in column-major order is calculated as
Address(a[i][j]) = ((j*m)+i)*Size + BA.
See lessIf you are using C language to implement the heterogeneous linked list, what pointer type should be used?
The heterogeneous linked list contains different data types, so it is not possible to use ordinary pointers for this. For this purpose, you have to use a generic pointer type like void pointer because the void pointer is capable of storing a pointer to any type.
The heterogeneous linked list contains different data types, so it is not possible to use ordinary pointers for this. For this purpose, you have to use a generic pointer type like void pointer because the void pointer is capable of storing a pointer to any type.
See lessCharging supercapacitors with reversed polarity
Electrolytic capacitor polarization is initially set at the factory by applying voltage to form the insulating oxide layer. That is why caps have a polarity and these standard supercaps are no different. Reversing the polarity will damage the original insulating layer first and then start to form aRead more
Electrolytic capacitor polarization is initially set at the factory by applying voltage to form the insulating oxide layer.
That is why caps have a polarity and these standard supercaps are no different. Reversing the polarity will damage the original insulating layer first and then start to form a new insulating layer with the applied polarity. It is not something that should be allowed to happen, so consider the capacitors damaged, or at least degraded, and they could be unstable and dangerous too.
Here is also what manufacturer says about reversing the polarity:
https://maxwell.com/wp-content/uploads/2021/08/Notes_on_Using_Ultracapacitor_Cells.pdf
See lessWhat is the difference between von Neumann architecture and Harvard architecture
VON NEUMANN ARCHITECTURE It is an ancient computer architecture based on the stored program computer concept. The same physical memory address is used for instructions and data. There is a common bus for data and instruction transfer. Two clock cycles are required to execute a single instruction. ItRead more
VON NEUMANN ARCHITECTURE
HARVARD ARCHITECTURE
If a table contains duplicate rows, will a query display duplicate values by default? How can you eliminate duplicate rows from a query result?
Yes, they will be displayed by default. To eliminate duplicate records, you use the DISTINCT keyword after the word SELECT.
Yes, they will be displayed by default. To eliminate duplicate records, you use the DISTINCT keyword after the word SELECT.
See lessWhat is a synonym?
A synonym is a database object that allows you to create a kind of “link” or “alias” to another database object. This is often done to hide the name of the actual object for security reasons or to improve the maintenance of the code in the future.
A synonym is a database object that allows you to create a kind of “link” or “alias” to another database object. This is often done to hide the name of the actual object for security reasons or to improve the maintenance of the code in the future.
See lessWhat is a unique constraint? How is it different from a primary key?
A unique constraint is a constraint on a table that says that a column or set of columns needs to have unique values. It’s different from a primary key in that a table can only have one primary key, but a table can have zero, one, or many unique constraints. Unique constraints can also allow NULL vaRead more
A unique constraint is a constraint on a table that says that a column or set of columns needs to have unique values.
It’s different from a primary key in that a table can only have one primary key, but a table can have zero, one, or many unique constraints.
Unique constraints can also allow NULL values, but primary keys cannot.
See lessWhat’s the difference between a view and a materialized view?
A view is simply an SQL query that is stored on the database, without the results. Every time a view is queried, this definition of the view’s query is run. If the underlying tables have been updated, the view will load these results. A materialized view is a query where the results have been storedRead more
A view is simply an SQL query that is stored on the database, without the results. Every time a view is queried, this definition of the view’s query is run. If the underlying tables have been updated, the view will load these results.
A materialized view is a query where the results have been stored in a permanent state, like a table. If the underlying tables are updated, then by default, the materialized views are not updated.
See lessWhich two messages does NameNode get from DataNode?
DataNodes provide NameNodes with information about the data in the form of messages or signals. The two indicators are: Block report signals, which is a list of the data blocks stored on the DataNode and an explanation of how they operate. DataNode's heartbeat, which indicates it’s active and workinRead more
DataNodes provide NameNodes with information about the data in the form of messages or signals.
The two indicators are:
Describe the HDFS Safe mode.
In a cluster, NameNode operates in read-only mode, while NameNode starts out in Safe Mode. Safe Mode inhibits writing to the file system. At this point, it gathers information and statistics from each DataNode.
In a cluster, NameNode operates in read-only mode, while NameNode starts out in Safe Mode. Safe Mode inhibits writing to the file system. At this point, it gathers information and statistics from each DataNode.
See lessHow is a file deleted in Python?
The file can be deleted by either of these commands: os.remove(filename) os.unlink(filename)
The file can be deleted by either of these commands:
See lessos.remove(filename)
os.unlink(filename)
Describe multithreading in Python.
Using Multithreading to speed up the code is not the go-to option, even though Python comes with a multi-threading package. The package has the GIL or Global Interpreter Lock, which is a construct. It ensures that only one of the threads executes at any given time. A thread acquires the GIL and perfRead more
Using Multithreading to speed up the code is not the go-to option, even though Python comes with a multi-threading package.
The package has the GIL or Global Interpreter Lock, which is a construct. It ensures that only one of the threads executes at any given time. A thread acquires the GIL and performs work before passing it to the next thread.
This happens so fast that to a user it seems that threads are executing in parallel. Obviously, this is not the case as they are just taking turns while using the same CPU core. GIL passing adds to the overall overhead of the execution.
As such, if you intend to use the threading package for speeding up the execution, using the package is not recommended.
See lessWhat is the difference between deep copy and shallow copy?
We use a shallow copy when a new instance type gets created. It keeps the values that are copied in the new instance. Just like it copies the values, the shallow copy also copies the reference pointers. Reference points copied in the shallow copy reference to the original objects. Any changes made iRead more
We use a shallow copy when a new instance type gets created. It keeps the values that are copied in the new instance. Just like it copies the values, the shallow copy also copies the reference pointers.
Reference points copied in the shallow copy reference to the original objects. Any changes made in any member of the class affect the original copy of the same. Shallow copy enables faster execution of the program.
Deep copy is used for storing values that are already copied. Unlike shallow copy, it doesn’t copy the reference pointers to the objects. Deep copy makes the reference to an object in addition to storing the new object that is pointed by some other object.
Changes made to the original copy will not affect any other copy that makes use of the referenced or stored object. Contrary to the shallow copy, deep copy makes the execution of a program slower. This is due to the fact that it makes some copies for each object that is called.
See lessWrite the postfix form of the expression: (A + B) * (C – D)
AB+CD-*
See lessAB+CD-*
Are linked lists considered linear or non-linear data structures?
A linked list is considered both linear and non-linear data structure depending upon the situation. Based on data storage, it is considered a non-linear data structure. Based on the access strategy, it is considered a linear data structure.
A linked list is considered both linear and non-linear data structure depending upon the situation.
What are the advantages of Linked List over an array?
The size of a linked list can be incremented at runtime which is impossible in the case of the array. The List is not required to be contiguously present in the main memory, if the contiguous space is not available, the nodes can be stored anywhere in the memory connected through the links. The ListRead more
Write the syntax in C to create a node in the singly linked list.
struct node { int data; struct node *next; }; struct node *head, *ptr; ptr = (struct node *)malloc(sizeof(struct node));
See lessstruct node
{
int data;
struct node *next;
};
struct node *head, *ptr;
ptr = (struct node *)malloc(sizeof(struct node));
Define the queue data structure.
A queue can be defined as an ordered list that enables insert operations to be performed at one end called REAR and delete operations to be performed at another end called FRONT.
A queue can be defined as an ordered list that enables insert operations to be performed at one end called REAR and delete operations to be performed at another end called FRONT.
See lessList the area of applications where stack data structure can be used?
Expression evaluation Backtracking Memory Management Function calling and return
What are FIFO and LIFO?
Both FIFO and LIFO are approaches to accessing, storing and retrieving elements from a data structure. LIFO stands for Last In First Out. In this approach, the most recently stored data is the one to be extracted first. FIFO stands for First In First Out. With this approach, the data that is storedRead more
Both FIFO and LIFO are approaches to accessing, storing and retrieving elements from a data structure. LIFO stands for Last In First Out. In this approach, the most recently stored data is the one to be extracted first.
FIFO stands for First In First Out. With this approach, the data that is stored earliest will be extracted first.
See less