
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

446 Views
As the name suggests, a container is used to hold or bind something likewise containers in bootstrap are used for storing or binding the content over a viewport. Containers add padding to the content by providing it margin from all the four sides of a viewport and it can also be altered depending upon the needs. Containers can also be nested inside one another.Now, let us understand each of the class in detailcontainerIn bootstrap, the .container class creates a responsive container with a fixed width in a viewport.It sets the max-width of a container depending upon the size of a ... Read More

1K+ Views
In this article, let us understand what is set and unordered_set in C++ STL and thereby gain knowledge of difference between them.What is set?A set is an Associative container which contains a sorted set of unique objects of type Key. Each element may occur only once, so duplicates are not allowed. A user can create a set by inserting elements in any order and the set will return a sorted data to the user which means set contains definition for sorting the data which is abstracted from the user.The main reasons when set can be used are −When sorted data ... Read More

399 Views
Given the task is to count the minimum frequency elements in a given linked list which is having duplicate elements.A linked list is a data structure in which the data is stored in the serial order, like a list each element is linked to the next element.The frequency of an element in a linked list refers to the number of times an element is occurring in the linked list. According to the problem we have to count the minimum frequency in a linked list.Let us suppose we have a linked list, 1, 1, 3, 1, 3, 4, 6; where the ... Read More

1K+ Views
Given the task is to count the number of edges in an undirected graph. An undirected graph is a set of vertices which are connected together to form a graph, whose all the edges are bidirectional. Undirected graphs can travel in any direction from one node to another connected node.Below is a visual representation of the undirected graph.Now, according to the problem we have to find the number of edges in the undirected graph.Edges in a graph are the lines to which two vertices are joined.Input −insert(graph_list, 0, 1); insert(graph_list, 0, 2); insert(graph_list, 1, 2); insert(graph_list, 1, 4); insert(graph_list, 2, ... Read More

825 Views
Suppose we have a list of numbers. We have to find the Hamming distance of all pair of given numbers. We know that the Hamming distance between two integers is the number of positions at which the corresponding bits are different.So, if the input is like [4, 14, 17, 2], then the output will be 17.To solve this, we will follow these steps −m := 1^9 + 7Define a function add(), this will take a, b, return ((a mod m) + (b mod m))Define a function mul(), this will take a, b, return ((a mod m) * (b mod m))Define ... Read More

318 Views
Suppose we have a gene string. That can be represented by a string whose length is 8, This string is consists of these letters [A, C, G, T]. Now consider we want to investigate about a mutation, where ONE mutation is actually ONE single character changed in the gene string. As an example, "AACCGTTT" is changed like "AACCGTTA" is 1 mutation.We also have a given gene "bank", where all the valid gene mutations are present. A gene must be in the bank to make it a valid gene string.Now suppose we have given 3 things - start, end, bank, our ... Read More

589 Views
Two lists are given. We need to find the index of the elements from the first list whose values match with the elements in the second list.With indexWe simply design follow to get the value of the element in the second list and extract the corresponding index from the first list.Example Live DemolistA = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'] listB = ['Tue', 'Fri'] # Given lists print("The given list: ", listA) print("The list of values: ", listB) # using indices res = [listA.index(i) for i in listB] # Result print("The Match indices list is : ", res)OutputRunning the above code gives ... Read More

1K+ Views
Given a Python list we want to find out only e e the last few elements.With slicingThe number of positions to be extracted is given. Based on that we design is slicing technique to slice elements from the end of the list by using a negative sign.Example Live DemolistA = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] # Given list print("Given list : ", listA) # initializing N n = 4 # using list slicing res = listA[-n:] # print result print("The last 4 elements of the list are : ", res)OutputRunning the above code gives us the following result −Given list ... Read More

772 Views
A Python dictionary contains key value pairs. In this article we will see how to get the key of the element whose value is maximum in the given Python dictionary.With max and getWe use the get function and the max function to get the key.Example Live DemodictA = {"Mon": 3, "Tue": 11, "Wed": 8} print("Given Dictionary:", dictA) # Using max and get MaxKey = max(dictA, key=dictA.get) print("The Key with max value:", MaxKey)OutputRunning the above code gives us the following result −Given Dictionary: {'Mon': 3, 'Tue': 11, 'Wed': 8} The Key with max value: TueWith itemgetter and maxWith itemgetter function we get ... Read More

3K+ Views
Python dictionary contains key value pairs. In this article we aim to get the value of the key when we know the value of the element. Ideally the values extracted from the key but here we are doing the reverse.With index and valuesWe use the index and values functions of dictionary collection to achieve this. We design a list to first get the values and then the keys from it.Example Live DemodictA = {"Mon": 3, "Tue": 11, "Wed": 8} # list of keys and values keys = list(dictA.keys()) vals = list(dictA.values()) print(keys[vals.index(11)]) print(keys[vals.index(8)]) # in one-line print(list(dictA.keys())[list(dictA.values()).index(3)])OutputRunning the above code gives ... Read More