
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

4K+ Views
In this article, we will show you how to copy only odd lines of a text file to another text file using python. Assume we have taken a text file with the name TextFile.txt consisting of some random text. We need to copy just all the odd lines of a text file into another and print them. TextFile.txt Good Morning This is the Tutorials Point sample File Consisting of Specific source codes in Python, Seaborn, Scala Summary and Explanation Welcome everyone Learn with a joy Algorithm (Steps) Following are the Algorithm/steps to be followed to perform the desired task ... Read More

29K+ Views
In this article, we will show you how to convert an excel file to the CSV File (Comma Separated Values) using python. Assume we have taken an excel file with the name sampleTutorialsPoint.xlsx containing some random text. We will return a CSV File after converting the given excel file into a CSV file. sampleTutorialsPoint.xlsx Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6300 20 Bhuvaneshwar Kumar 34 Batsman India Sun Risers Hyderabad 333 140 Mahendra Singh Dhoni 39 Batsman India Chennai Super Kings 4500 ... Read More

19K+ Views
In this article, we will show you how to convert a CSV File (Comma Separated Values) to an excel file using the pandas module in python. Assume we have taken an excel file with the name ExampleCsvFile.csv containing some random text. We will return a CSV File after converting the given excel file into a CSV file. ExampleCsvFile.csv Player Name Age Type Country Team Runs Wickets Virat Kohli 33 Batsman India Royal Challengers Bangalore 6300 20 Bhuvneshwar Kumar34 Batsman India Sun Risers Hyderabad 333 140 Mahendra Singh Dhoni 39 Batsman India Chennai ... Read More

14K+ Views
In this tutorial, we will learn how to print an integer in the Golang Programming language. The fmt package is used to perform the input/output operations which are comparable to the input/output functions in C i.e scanf and printf. Also, format specifiers are referred from C but in Golang they are simple. We will discuss what specifiers we have for integers. Specifiers are something which will tell us the what data type we are printing. %b − for base 2 %o − for bae 8 %d − for base 10 Functions in fmt package:− fmt.Printf() − It ... Read More

753 Views
In a binary search tree (BST), the second largest element must be returned. In a binary tree, the second element is the largest element. According to the given BST, 13 is the second largest element. Now we are using the C++ approach to solve this problem. We can traverse the tree inorder, and by observation, we can observe that the second largest element in the given BST is 13. The inorder of the tree will be 1 3 4 6 7 8 10 13 14, and we can observe that the elements are in the sorted array. So we ... Read More

823 Views
In this article, we are given a BST (binary search tree), and we need to find the shortest distance between 2 given nodes in the BST. Let's have a tree and below are the following scenarios. Let’s assume some simple input and output scenarios Now we have to find the distances between nodes 4 and 13. int key1=13, key2=4; res = solve(root, min(key1, key2), max(key1, key2)); output = 6 The shortest distance is 6, which is through 4->6->3->8->10->14->13(the arrows show a path definition and not anything else). Let’s find another distance from two different nodes in the above ... Read More

375 Views
Suppose we have a binary tree and we want to replace the depth of each node with its value. The depth of the node starts from 0 at the root node and increases by 1 for each level we go; for example, we have a binary tree like this; Here we replace, Node Value Depth 1 0 2 1 3 1 4 2 5 2 6 2 7 2 8 3 9 3 We do a simple ... Read More

365 Views
We are given a binary tree, and we need to replace all the elements with the sum of its inorder predecessor and successor. Inorder is a traversed path in a graph that reads in the order of left node – root node – right node. The method adds the elements in left and right nodes of the parent node and replaces the value with the obtained sum. Suppose we have a tree with the following formation and characters − We can find and store the inorder of the tree in an array. After that, we can again do an ... Read More

313 Views
Given two integers N and k, we need to count the number of derangements where k points are fixed at their position. Given constraints on k are between 0 and n as the number of fixed points when there are n points cannot be more than n. int N=4, k=2; res = solve(N, k); Note that at least conditions don’t hold on k. There has to be precisely and strictly k points on their original index. This is a mathematical problem. Not explaining the proof and explanation of mathematics, we as computer science majors can use the results ... Read More

205 Views
Suppose we are given a binary tree and three nodes in that binary. We have to disconnect one node entirely from the tree. Disconnecting that node leaves us with three different trees. Each of the three given nodes lies in one of them, or each of the given three nodes must not exist in the same tree. Disconnecting a node means that we will remove all the edges from this node to all other nodes. Example For example, let's say we have a tree with three nodes 18, 15, and 17 as shown below − If the task ... Read More