Found 1862 Articles for Data Structure

Difference Between E-R Model and Relational Model in DBMS

Kiran Kumar Panigrahi
Updated on 20-Dec-2022 12:56:01

5K+ Views

In Database Management Systems (DBMS), the ways of designing databases at physical, logical, and view levels are referred to as Data Models. There are two popular data models− the ER Model and the Relational Model. The fundamental difference between the ER Model and the Relational Model is that the ER Model is an entityspecific data model, while the relational model is a table specific model. Read this article to find out more about the ER Model and the Relational Model and how they are different from each other. What is ER Model? ER Model, short for Entity Relationship Model, is ... Read More

Difference Between Trigger and Procedure

AmitDiwan
Updated on 15-Apr-2021 07:48:12

1K+ Views

In this post, we will understand the difference between trigger and a procedure.TriggersIt is implicitly invoked when an event such as INSERT, DELETE, and UPDATE occurs in a table of a database.Nesting of triggers can be achieved using a table.A trigger can’t be called or defined inside another trigger.Transactional statements such as ‘COMMIT’, ‘ROLLBACK’, ‘SAVEPOINT’ can’t be used in triggers.They are used to maintain referential integrity.This is done by keeping a record of the activities performed on a table.No values are returned in a trigger.No value can be passed as a parameter to a trigger.Syntax to define a trigger:CREATE TRIGGER ... Read More

Difference Between Star and Snowflake Schema

AmitDiwan
Updated on 15-Apr-2021 07:35:33

259 Views

In this post, we will understand the difference between star schema and snowflake schema.Star SchemaHierarchies of dimensions are stored in a dimensional table.It contains a fact table that is surrounded by dimension tables.In this schema, a single join creates the relationship between a fact table and any dimension tables.It is a simple database design.It has high levels of data redundancy.The processing of cube is quick.A single dimension table contains the aggregated data.It is a de-normalized data structure.The queries run quickly in comparison to other schema.It uses start join query optimization technique. Hence, the queries perform well.Tables can be connected with ... Read More

Difference Between Classification and Regression

Kiran Kumar Panigrahi
Updated on 20-Dec-2022 12:28:23

11K+ Views

In data mining, there are two major predication problems, namely, classification and regression. The most basic difference between classification and regression is that classification algorithms are used to analyze discrete values, whereas regression algorithms analyze continuous real values. The output variable must be either continuous nature or real value. The output variable in classification has to be a discrete value. In contrast, the output variable in regression must be either continuous in nature or real values. In this article, we will discuss all the important differences between classification and regression. Let's start with some basics of Classification and Regression so ... Read More

Explain the Difference Between Linear and Non-linear Data Structure

AmitDiwan
Updated on 23-Mar-2021 07:11:07

653 Views

In this post, we will understand the difference between linear data structure and non-linear data structure.Linear Data StructureThe elements of such a structure are arranged sequentially.Every element can be accessed by traversing through the linear structure.All the elements of a linear structure are at a single level, i.e there is no hierarchy.They are easy to implement and use.They utilize more memory, hence they are not very memory-friendly.The time complexity of linear data structure usually increases when the size of the structure increases.Examples include- list, array, stackThe below shows an example of a list in Python.my_list = [45, 42, 12, 34, ... Read More

Yen's k-Shortest Path Algorithm in Data Structure

Dev Prakash Sharma
Updated on 23-Feb-2021 06:35:29

1K+ Views

Instead of giving a single shortest path, Yen’s k-shortest path algorithm gives k shortest paths so that we can get the second shortest path and the third shortest path and so on.Let us consider a scenario that we have to travel from place A to place B and there are multiple routes available between place A and place B, but we have to find the shortest path and neglect all the paths that are less considered in terms of its time complexity in order to reach the destination.Let us understand with an example-Consider the given example as the bridge which ... Read More

Algorithm to construct an Expression Tree in Data Structure

Dev Prakash Sharma
Updated on 23-Feb-2021 18:11:51

7K+ Views

Expression treesExpression trees are those in which the leaf nodes have the values to be operated, and internal nodes contain the operator on which the leaf node will be performed.Example4 + ((7 + 9) * 2) will have an expression tree as followsAlgorithm to Construct an Expression TreeLet T be the expression tree.If T is not NULL:   If T->data is an operand:      return T.data   A = solve(T.left)   B = solve(T.right)   --> Calculate operator for 'T.data' on A and B, and call recursively,       return calculate(A, B, T.data)How to construct an expression tree?To construct an Expression Tree for ... Read More

Insertion in the Red Black Tree in Data Structure

Dev Prakash Sharma
Updated on 05-Feb-2021 12:42:32

7K+ Views

Red Black Tree is a Self-Balanced Binary Search Tree in which each node of the tree is colored with either Red or Black. There are three types of operations we can perform on a Red Black Tree – Searching, Insertion and Deletion.Let us suppose we have to insert an element in the following Red Black Tree.To insert an element in a red-black tree the idea is very simple − we perform insertion just like we insert in a regular binary tree. We start off from the root node by checking the color of the node and insert it into a ... Read More

Floyd Cycle Detection Algorithm to detect the cycle in a linear Data Structure

Dev Prakash Sharma
Updated on 05-Feb-2021 12:22:42

485 Views

Floyd Cycle is one of the cycle detection algorithms to detect the cycle in a given singly linked list.In the Floyd Cycle algorithm, we have two pointers that initially point at the head. In Hare and Tortoise’s story, Hare moves twice as fast as Tortoise, and whenever the hare reaches the end of the path, the tortoise reaches the middle of the path.AlgorithmInitialize Hare and Tortoise at the head node of the List.Initially, the hare moves twice as fast as the tortoise.Move the hare and tortoise both and find if the hare reaches the end of the Linked List, return ... Read More

How to implement immutable Data structures in Python?

Kiran P
Updated on 09-Nov-2020 10:16:00

317 Views

ProblemYou need to implement immutable data structures in Python.Introduction..Immutable data structures are very handy when you want to prevent multiple people modifying a piece of data in parallel programming at same time. Mutable data structures( e.g. Array) can be changed at any time while immutable data structures cannot be.How to do it..Let me show you step by step how to deal with immutable and mutable data structures.Example# STEP 01 - Create a Mutable array. # Define an array atp_players = ['Murray', 'Nadal', 'Djokovic'] print(f" *** Original Data in my array is - {atp_players}")*** Original Data in my array is ... Read More

Advertisements