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
Server Side Programming Articles - Page 210 of 2650
9K+ Views
In this tutorial, we are going to learn how we can install pip in a Docker container using a Dockerfile. This tutorial will cover the creation of the Dockerfile and then we will see the docker command to build a docker image from the Dockerfile, and in last we will see the docker command to run a container based on that image and see whether PIP is installed properly or not. Prerequisites There are some prerequisites to creating and building the Dockerfile as mentioned below. The stable version of Docker should be installed. Create a file in any folder ... Read More
158 Views
In Golang, like other programming languages, we can code the logic to sort an array that has 0’s, 1’s, and 2’s as elements. Sorting means assigning the data either in increasing order or in decreasing order. This is one of the famous questions on the array asked in interviews. There can be two approaches to achieve this that we are going to explore one by one. For example, we have an array 2, 1, 0, 0, 1, 2, and after sorting the array will look like 0, 0, 1, 1, 2, 2. Method 1 In this example, we are going ... Read More
216 Views
There is a famous maximum sum subarray problem, in which we have a 1 Dimensional array and must find the maximum sum in that subarray. To solve this problem, the most naive approach will be to find all the sub − arrays, sum their elements, and return the maximum, but the time complexity will be O(N*N). To reduce this there is an algorithm that will reduce the time complexity from O(N*N) to O(N) named as Kadens Algorithm. In programming, there are algorithms based on the Dynamic programming concept in which the problem is broken into sub − problems and the ... Read More
521 Views
In programming, to search for anything from an array, linked List, or from any other data structures we have a few search algorithms, one of which is Linear search. In the linear search, we iterate over the data structure from starting and search for the element till the last index. The advantage of a linear search algorithm is that we can perform this search of both sorted and unsorted data. The disadvantage is that for sorted or unsorted both kinds of data it will take the same amount of time to find an element. For example, we have an array ... Read More
659 Views
In programming, to search for anything from an array, linked List, or any other data structures we have a few search algorithms, one of which is binary search. In binary search, the prerequisite is that the data should be sorted. In binary search, we follow the divide and conquer approach in which we divide the data by applying some conditions and then perform the operation on that data only. In this way, we reduce the time complexity. For example, if we have an array of elements {20, 44, 45, 54, 67, 88, 91} and we want to find 44 then ... Read More
896 Views
In Golang, like other programming languages, we can find the union of two arrays. The union of two arrays is a list that consists of elements that lie in array A and the elements that lie in array B and common elements that lie in both arrays. For example, we have two arrays listed below A = {2, 9, 5, 7, 3} B = {5, 8, 7 2, 1} The union of the above arrays will be Union = {1, 2, 3, 5, 7, 8, 9} Method 1 In this method, we are going to find the union of two ... Read More
154 Views
In programming languages, we can create 2−Dimensional Matrices and store elements in them. The 2−Dimensional metric is a data structure that has rows and columns. In this article, we are going to see the two different logic to find the maximum no. of ones in a sorted row of the matrix. For example, we have below the matrix {0, 1, 1, 1}, no. of 1s = 3 {0, 0, 1, 1}, no. of 1s = 2 {1, 1, 1, 1}, no. of 1s = 4 {0, 0, 0, 0}, no. of 1s = 0 In the ... Read More
2K+ Views
In programming, there is a problem statement asked in interviews to find the duplicate number in an array of size N + 1. Also, there will be only one duplicate element in the array. The elements will be between 1 to N. For example, Array = {1, 3, 2, 1, 4} 1 is the duplicate element in the above array. Algorithm Step 1: Import the required packages at the top using the import keyword. Step 2: Then the main function will get run first. First, we are declaring and initialize the array. Now, we are calling the function to ... Read More
208 Views
In programming, there is a coding problem of binary tree that gets asked very frequently in interviews and the problem statement is to find the right view of a binary tree. If we try to understand the problem statement more than what exactly the right view is then we can explain it in a way that all the nodes are visible when you see them by standing on the right side of the tree. Illustration Let us understand more with the help of an example. Suppose we have a below tree and if we stand on the right side ... Read More
540 Views
In programming, there are different data structures to store data. There are two different types of data structures linear and non −linear. Array, stack, queue, and linked list are linear data structures. Binary trees, trie, etc are non − linear data structures. In this article, we are going to explore level order traversal on one of the non − linear data structures i.e. binary tree. Level Order Traversal In level order traversal, of a binary tree we start from the root node and then traverse the children nodes and move to the children of children nodes. In this way, ... Read More