Articles on Trending Technologies

Technical articles with clear explanations and examples

C++ Perimeter and Area of Varignon's Parallelogram

Prateek Jangid
Prateek Jangid
Updated on 25-Nov-2021 403 Views

Varignon’s Parallelogram is formed by joining midpoints of each side of a quadrilateral. Let’s say we have a quadrilateral ABCD. The midpoints of each side are P, Q, R, and S. If we connect all the midpoints, it will always form a parallelogram PQRS known as Varignon’s Parallelogram.In this tutorial, we will discuss how to find the perimeter and area of Varignon’s Parallelogram with the given two diagonals and the area of a quadrilateral, for example −Input: d1 = 6, d2 = 9, Area = 12 Output: Perimeter = 15 Area = 6 Input: d1 = 11, d2 = ...

Read More

C++ Pentatope Number

Prateek Jangid
Prateek Jangid
Updated on 25-Nov-2021 320 Views

A pentatope number is described as the fifth number in the pascal’s triangle. Now, as you know, it’s the fifth number, so it means that we need to have at least five numbers in the pascal’s triangle, so this series’ first number starts from 1 4 6 4 1 the fourth row of pascal’s triangle. So, In this given tutorial, we are required to find the nth pentatope number, for exampleInput : 1 Output : 1 Input : 4 Output : 35 You can check the output from the following diagram −Now for this problem, as ...

Read More

C++ Path with Maximum Average Value

Prateek Jangid
Prateek Jangid
Updated on 25-Nov-2021 321 Views

Given a 2 D matrix in this problem, and we need to find the paths having maximum average value. For the path, our source is the topmost left cell, and the destination is the bottommost right cell, for example −Input : Matrix = [1, 2, 3 4, 5, 6 7, 8, 9] Output : 5.8 Path with maximum average is, 1 -> 4 -> 7 -> 8 -> 9 Sum of the path is 29 and average is 29/5 = 5.8In this problem, we are allowed to move only right or downwards. This makes our problem easier as we know ...

Read More

C++ Path Length having Maximum Number of Bends

Prateek Jangid
Prateek Jangid
Updated on 25-Nov-2021 347 Views

To solve a problem in which we are given a binary tree. Now we need to find the path having the maximum number of bends. i.e., A bend is considered when the direction of the path changes from left to right or vice versa, for exampleInput −Output −6Now in this approach, we will traverse through the tree and keep track of previous movements. If the direction changes, we simply update our bends count, and then we find the maximum.Approach to Find the SolutionIn this approach, we will traverse through all the paths, and we find the maximum number of bends ...

Read More

C++ Partition a Number into Two Divisible Parts

Prateek Jangid
Prateek Jangid
Updated on 25-Nov-2021 415 Views

In this problem, we are given a string that can be interpreted as a number. Now we have to perform the partition that string into two parts such that the first part is divisible by A and the second part is divisible by B (two integers given to us). For example −Input : str = "123", a = 12, b = 3 Output : YES 12 3 "12" is divisible by a and "3" is divisible by b. Input : str = "1200", a = 4, b = 3 Output : YES 12 00 Input : str = ...

Read More

C++ Partitioning a Linked List Around a Given Value and Keeping the Original Order

Prateek Jangid
Prateek Jangid
Updated on 25-Nov-2021 460 Views

Given a linked list in this tutorial, and we need to keep all the numbers smaller than x at the start of the list and the others at the back. We also need to retain their order the same as previously. for exampleInput : 1->4->3->2->5->2->3, x = 3 Output: 1->2->2->3->3->4->5 Input : 1->4->2->10 x = 3 Output: 1->2->4->10 Input : 10->4->20->10->3 x = 3 Output: 3->10->4->20->10To solve this problem, we need to make three linked lists now. When we encounter a number smaller than x, then we insert it into the first list. Now for a value equal ...

Read More

C++ Pandigital Number in a Given Base

Prateek Jangid
Prateek Jangid
Updated on 25-Nov-2021 779 Views

A number that contains all the digits from 0 to base B is called the Pandigital number in that base. However, some numbers have digits from 1 to 9 and are called zeroless pandigital numbers. Some Examples of pandigital numbers are 0123456789, 0789564312, etc.In this tutorial, we will discuss a problem where we are given a number and a base, and we need to check whether the number is pandigital in the given base or not, for example −Input: num = “9651723467380AZ”, base = 10 Output: YES Explanation: num contains all the digits in the base 10 i.e from 0 ...

Read More

C++ Pairwise Swap Elements of a Given Linked List

Prateek Jangid
Prateek Jangid
Updated on 25-Nov-2021 690 Views

To solve a problem in which we are required to swap the pairwise nodes present in a linked list and then print it, for exampleInput : 1->2->3->4->5->6->NULL Output : 2->1->4->3->6->5->NULL Input : 1->2->3->4->5->NULL Output : 2->1->4->3->5->NULL Input : 1->NULL Output : 1->NULLThere are two ways to approach the solution both to have a time complexity of O(N), where N is the size of our provided linked list, so now we are going to explore both of the approachesIterative ApproachWe will iterate through the linked list elements in this approach, and pairwise swap them until they ...

Read More

What are the techniques of Text Indexing?

Ginni
Ginni
Updated on 25-Nov-2021 2K+ Views

There are several popular text retrievals indexing techniques such as inverted indices and signature files.Inverted Index − An inverted index is an index structure that maintains two hash indexed or B+-tree indexed tables: document_table and term_table, where document_table consists of a set of document records, each including two fields: doc_id and posting_list, where posting_list is a list of methods (or pointers to methods) that appears in the document, arranged according to some relevance measure.term_table includes a set of term records, each including two fields: term_id and posting_list, where posting_list specifies a list of records identifiers in which the term occurs.It ...

Read More

What are the methods of Text Retrieval?

Ginni
Ginni
Updated on 25-Nov-2021 5K+ Views

Text retrieval is the process of transforming unstructured text into a structured format to identify meaningful patterns and new insights. By using advanced analytical techniques, including Naïve Bayes, Support Vector Machines (SVM), and other deep learning algorithms, organizations are able to explore and find hidden relationships inside their unstructured data. There are two methods of text retrieval which are as follows −Document Selection − In document selection methods, the query is regarded as defining constraint for choosing relevant documents. A general approach of this category is the Boolean retrieval model, in which a document is defined by a set of ...

Read More
Showing 46931–46940 of 61,299 articles
Advertisements