Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 22 of 81

C++ Program to Implement Max Heap

Chandu yadav
Chandu yadav
Updated on 07-Mar-2025 14K+ Views

In this article, we will write a C++ program that implements a Max Heap. A Max Heap is a binary tree where the value of each node is greater than or equal to the values of its children. We will explain how to create a Max Heap using arrays and implement operations like insertion and deletion. The article will cover the following topics: What is a Heap? What is Max Heap? What is Heapify? Max Heap Implementation Deletion from ...

Read More

How to print out the contents of a vector in C++?

Chandu yadav
Chandu yadav
Updated on 14-Feb-2025 35K+ Views

Vectors are similar to the dynamic arrays but vectors can resize. They are sequence containers that can change their size according to the insertion or deletion of elements. Containers are the objects which holds the data of same type. Vectors may allocate some extra storage for the future growth of elements in the vector. Its elements are stored in the contiguous memory. The data is entered at the end of vector. In this article, we will show you how to print the contents of a vector in C++. Example Scenario: std::vector vec = {10, 20, 30, 40, 50}; You ...

Read More

Java program to deselect a range of columns in a JTable

Chandu yadav
Chandu yadav
Updated on 14-Nov-2024 278 Views

In this article, we will learn how to deselect a range of columns in a JTable using Java. JTable is a part of the Swing framework in Java, which is used to display and edit tables. Sometimes, we may want to deselect a specific range of columns after selecting columns in a table. This can be done by using the removeColumnSelectionInterval() method. Problem Statement Given a JTable with columns selected, write a Java program to deselect a range of columns from the table. Input A JTable with columns selected.Output The specified range of columns will be deselected. Steps to ...

Read More

Compilation and Execution of a C# Program

Chandu yadav
Chandu yadav
Updated on 15-Oct-2024 22K+ Views

To compile and execute a program in C#, you just need to click the Run button or press F5 key to execute the project in Microsoft Visual Studio IDE. Compile a C# program by using the command-line instead of the Microsoft Visual Studio IDE − Open a text editor and add the above-mentioned code. Save the file as helloworld.cs Open the command prompt tool and go to the directory where you saved the file. Type csc helloworld.cs and press enter to compile your code. If there are no errors in your code, the command prompt takes you to the next line and ...

Read More

Java program to find if the given number is a leap year?

Chandu yadav
Chandu yadav
Updated on 13-Sep-2024 80K+ Views

In this article, we will learn to find if a year is a leap year or not using Java. Finding whether a year is a leap or not is a bit tricky. We generally assume that if a year number is evenly divisible by 4 is a leap year. But it is not the only case. A year is a leap year if − It is evenly divisible by 100 If it is divisible by 100, then it should also be divisible by 400 Except this, all ...

Read More

Set a border around navbar with CSS

Chandu yadav
Chandu yadav
Updated on 12-Sep-2024 9K+ Views

To set a border around navbar with CSS, is an easy task and can be easily achieved using CSS properties. In this article, we will learn and understand three different approaches for setting a border around navbar with CSS. We are having a navigation bar with four links in our HTML document, our task is to set a border around navbar with CSS. Approaches to Set a Border Around Navbar Here is a list of approaches to set a border around navbar with CSS which we will be discussing in this article with stepwise explaination and complete example codes. ...

Read More

Java program to check occurrence of each character in String

Chandu yadav
Chandu yadav
Updated on 05-Sep-2024 26K+ Views

To find the occurrence of each character in a string we can use the Map utility of Java. In Map a key cannot be duplicated so make each character of the string a key of Map and provide the initial value corresponding to each key as 1 if this character is not inserted in Map before. Now when a character repeats during insertion as a key in Map increases its value by one. Continue this for each character until all characters of the string get inserted. Problem Statement Write a program in Java to check the occurrence of each character in ...

Read More

Java program to determine when a Frame or Window is closing

Chandu yadav
Chandu yadav
Updated on 30-Aug-2024 2K+ Views

In this article, we will learn to determine when a Frame or Window is closing in Java. We will create a simple window in Java Swing titled "Demo". It displays styled text (italic, black on orange) using a text pane inside a scrollable area. The program also listens for window-closing events, printing a message when you close it. This basic example is how to build a GUI with text styling and event handling.Steps to determine when a Frame or Window is closing Following are the steps to determine when a Frame or Window is closing in Java − ...

Read More

Java object creation of Inherited class

Chandu yadav
Chandu yadav
Updated on 22-Aug-2024 2K+ Views

The constructor is something responsible for the object creation of a particular class in Java. Along with other functions of the constructor, it also instantiates the properties/instances of its class. In Java by default super() keyword is used as the first line of the constructor of every class, here the purpose of this method is to invoke the constructor of its parent class so that the properties of its parent get well instantiated before subclass inherits them and use. The point that should remember here is when you create an object the constructor is called but it is not mandatory that ...

Read More

Java Program to add Combo Box to JTable

Chandu yadav
Chandu yadav
Updated on 19-Aug-2024 3K+ Views

In this article, we will learn how to add a JComboBox to a JTable in Java Swing. The JComboBox allows you to create a drop-down list within a table cell, enabling users to select from predefined options. Steps to add a combo box to JTable Following are the steps to add a combo box to JTable − First import the necessary packages. Initialize a JTable with 5 rows and 5 columns. Create a JComboBox and add items to it. Get the first column of ...

Read More
Showing 211–220 of 810 articles
« Prev 1 20 21 22 23 24 81 Next »
Advertisements