- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Karthikeya Boyini has Published 2383 Articles
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
1K+ Views
Prim's algorithm is a greedy algorithm that finds a minimum spanning tree for a weighted undirected graph. It finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized.The algorithm operates by building this ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
131 Views
Functions which have been commented out in this code. You can switch to those as well. We've also moved the Queue, Stack, and PriorityQueue classes in different modules that can be imported using either import statements or using require calls. Here is the complete implementation of the Graph class − Exampleconst ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
215 Views
An AVL tree (named after inventors Adelson-Velsky and Landis) is a self-balancing binary search tree. A self-balancing tree is a tree that performs some rotation within it's subtrees so that it can be balanced on both left and right side.These trees are particularly helpful in cases where insertions cause a ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
667 Views
AVL tree checks the height of the left and the right sub-trees and assures that the difference is not more than 1. This difference is called the Balance Factor.For example, in the following trees, the first tree is balanced and the next two trees are not balanced −In the second ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
161 Views
We can learn how we can insert a node in an AVL Tree. Insertions in AVL trees are the same as BST, we just need to perform one extra step called balance tree during insert whenever we move down the tree.This requires calculating the balance factor which we already saw ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
1K+ Views
We'll be creating a graph class that supports weights and both directed and undirected types. This will be implemented using an adjacency list. As we move to more advanced concepts, both weights and directed nature of the graphs will come in handy.An adjacency list is an array A of separate ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
4K+ Views
BFS visits the neighbor vertices before visiting the child vertices, and a queue is used in the search process. Following is how a BFS works −Visit the adjacent unvisited vertex. Mark it as visited. Display it. Insert it in a queue.If no adjacent vertex is found, remove the first vertex ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
136 Views
The formenctype attribute is used to show how the form data should be encoded when it is submitting to the server. It introduced in HTML5 and only used with input type submit an image.Here are the formenctype attribute values −S.NoValue & Description1application/x-www-form-urlencodedThis is the default. All the characters are encoded before sent.2multipart/form-dataNone ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
179 Views
Let us understand how we're going to create and represent a binary search tree in Javascript. We'll first need to create the class BinarySearchTree and define a property Node on it. Exampleclass BinarySearchTree { constructor() { // Initialize a root element to null. this.root ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
349 Views
We're going to use the property of a BST to look up elements in it. Let us look at first an iterative implementation of search − ExamplesearchIter(data) { let currNode = this.root; while (currNode !== null) { if (currNode.data === data) { ... Read More