Found 33676 Articles for Programming

Check if Alternate Paths Exists from U toV with Smaller Individual Weight in a given Graph

Ayush Singh
Updated on 13-Jul-2023 19:20:33

115 Views

In graph analysis, one common job is determining whether or not there is a path from node U to node V that has a lower total weight than the one currently being used. Checking for other paths between nodes that have a lower total weight than the current path is what this entails. The Floyd−Warshall and Bellman−Ford algorithms are two methods that are often utilised. The Floyd−Warshall technique calculates the cost of traversing any pair of nodes in order to compare various routes through a graph. However, by determining the shortest routes from a single source node to all other ... Read More

Check if a Cycle of Length 3 Exists or Not in a Graph that Satisfy a given Condition

Ayush Singh
Updated on 13-Jul-2023 19:15:33

340 Views

To check in the event that a cycle of length 3 exists in a chart fulfilling a given condition, ready to repeat through each vertex and look at its neighbouring vertices. On the off chance that a vertex has two neighbours that are too associated, a cycle of length 3 exists. This condition guarantees that there's an edge between the two neighbours, creating a triangle. By filtering all vertices and their adjoining vertices, we will recognise whether such a cycle exists or not. In the event that we discover a vertex with two associated neighbours, we are able to conclude ... Read More

Add and Remove Vertex in Adjacency Matrix Representation of Graph

Ayush Singh
Updated on 13-Jul-2023 19:04:18

805 Views

Including a vertex within the contagiousness network representation of a chart means expanding the measure of the network by one push and one column. The unused push and column speak to the associations of the recently included vertex with the existing vertices. Additionally, expelling a vertex requires evacuating its comparing push and column from the contagiousness lattice, subsequently altering the measure of the network in like manner. Including a vertex includes adding a push and column with beginning values of 0, whereas evacuating a vertex includes erasing the comparing push and column, viably decreasing the measure of the lattice. Methods ... Read More

Add and Remove Edge in Adjacency List Representation of Graph

Ayush Singh
Updated on 13-Jul-2023 18:51:28

1K+ Views

Adjacency lists effectively store graph relationships. Graph algorithms and operations use it. Adding and deleting edges can dynamically change the connections between vertices. Graph modification, connection analysis, and evolution need this procedure.Adding and deleting edges link and detach vertices, respectively. The adjacency list representation commonly performs these actions by altering the vertices' adjacency lists. Using a vector of vectors, sets, or maps of sets may change the implementation.New edges create pathways and linkages in the graph. However, removing edges breaks connections, changing graph structure and dynamics. These procedures are essential for graph adjacency list integrity and evolution. Methods Used ... Read More

How to stop event propagation in Python Tkinter?

Kiran Kumar Panigrahi
Updated on 05-Sep-2023 11:39:11

995 Views

Tkinter events are very powerful in handling the different objects and attributes of the widgets as well as the elements of an application. There are events such as mouse events and keyboard button events that can be handled by binding the event or callback function with the button. Let us assume that we are creating an application that has two events of clicking the objects defined in a canvas widget. The two objects are basically the shapes (a rectangle and an oval) defined inside the canvas. We can perform actions like the Button Click event to verify if the use ... Read More

Python: How to update tkinter labels using a loop?

Kiran Kumar Panigrahi
Updated on 05-Sep-2023 11:35:19

2K+ Views

We normally use the Tkinter Label widget to display text and images in an application. Let us assume that we want to create an application such that the Label widget continuously gets updated with a value whenever the application executes. To achieve this, we will use a StringVar object and update its value using a while loop that will iterate as long as a particular condition satisfies. A StringVar object in Tkinter can help manage the value of a widget such as an Entry widget or a Label widget. You can assign a StringVar object to the textvariable of a ... Read More

Python: How to put a border around an OptionMenu using Tkinter?

Kiran Kumar Panigrahi
Updated on 05-Sep-2023 11:33:48

715 Views

To save the contents of a Textbox in Tkinter, we can take the following steps − Create an instance of tkinter frame. Set the size of the frame using win.geometry method. Define a user-defined method "open_text" to open a text file in "read" mode. Read the contents of the text file and save it in a variable called "content". Then, use the "insert" method to insert the content in a Textbox. Next, define another user-defined method called "save_text" and in it, use the "write" method to save the contents of the textbox in the text file. Create ... Read More

Data Distribution in Cassandra

Amrendra Patel
Updated on 14-Jul-2023 15:49:15

468 Views

Data distribution is done through consistent hashing to make the data evenly distributed across the nodes in a cluster. Instead of getting rows of table on a single node, rows gets distributed across the clusters which make the load of table data get evenly divided. The partition key is used to distribute data among nodes and determine data locality. In Cassandra, data distribution and replication work together. Mainly depends on three things i. e. partition key, key value, and token range. Cassandra Table This table consists of two rows in which one row has four columns followed by ... Read More

Cursors in DBMS

Amrendra Patel
Updated on 14-Jul-2023 14:53:42

8K+ Views

A temporary work area known as a cursor is established in the system memory whenever DML statements are performed. Although a cursor may contain many rows, processing−wise, only one row is taken into consideration. Cursors are very helpful to the kind of DBMSs like Oracle, Mysql, SQL servers, etc. A cursor is a control structure to go through database records and is used in databases. Cursors are of two types Implicit Cursors Explicit Cursors Implicit Cursors If you don't use an explicit cursor for the statement, Oracle will create implicit cursors while the SQL statement is performed. Some ... Read More

Double Buffering

Amrendra Patel
Updated on 14-Jul-2023 12:06:27

1K+ Views

Double buffering is essential for improving user experience and performance. This method is extensively used to reduce delays, increase performance, and enable smooth multitasking in database management systems, streaming media applications, and graphics rendering. In order to optimise data transit and processing, double buffering is used which is a programming approach that uses two buffers or temporary storage spaces. It enables the execution of input and output processes simultaneously, thereby minimising delays and enhancing system performance as a whole. Double buffering allows for efficient multitasking and effective resource management by using one buffer for data storage while the other ... Read More

Advertisements