Linux Package Management with Aptitude

Sharon Christine
Updated on 17-Jan-2020 09:43:08

361 Views

Aptitude is founded by Ncurses for APT front End and debian Bundle Manager, considering the fact that it is text-based and it runs from a terminal or a CLI – command line interface. This article explains about-“Linux Package Management with Aptitude”What is APTapt is a command line package manager and provides commands for searching and managing as well as querying information about packages. It provides the same functionality as the specialized APT tools, like apt-get and apt-cache, but enables options more suitable for interactive use by default.]To get more information about APT, use the following command –$ aptThe sample output ... Read More

Print All Sum Pairs Occurring Maximum Times in C++

sudhir sharma
Updated on 17-Jan-2020 09:42:13

179 Views

In this problem, we are given an array of n unique integers. And we have to find the sum of two integers of the array which has the maximum frequency. The problem has multiple solutions and you need to find them all.Input : array = { 1, 12, 5, 7, 9, 11} Output : 16 12Explanation − sum 16 and 12 occur two times.5 + 11 = 16 & 7 + 9 = 16 1 + 11 = 12 & 5 + 7 = 12Now to solve this problem, our approach to the problem is checking the occurrence every sum ... Read More

Print All Triplets in Sorted Array that Form AP in C++

sudhir sharma
Updated on 17-Jan-2020 09:39:52

240 Views

In this problem, we are given a sorted array of numbers and we need to find the triplets with are in the form of arithmetic progression.An arithmetic progression is a series of numbers in which the difference between consecutive terms is the same.Let’s take an example to understand the problem better −Input : array = {2 , 5 , 7, 8 , 9 , 10} Output : 2 5 8 5 7 9 7 8 9 8 9 10To solve this problem, a simple solution would be running three loops and checking all triplets if they are in AP. but ... Read More

Test Disk I/O Performance with dd Command in Linux and Unix

Sharon Christine
Updated on 17-Jan-2020 09:39:43

9K+ Views

Do you know how to check the performance of a hard drive like checking the read and write speed on your Linux operating systems? then, this article is for you!! which is basically created to provide you an overview of DD command, which is geared towards better guidance to new users and as an exploration tour for getting started to the Linux world.What is DD Command?DD is a command-line utility for Unix and Unix-like operating systems where the primary purpose is to copy a file and converting the format of the data during the process.How to Test Hard Disk using ... Read More

Why Less is Faster than More Command for Effective File Navigation

Sharon Christine
Updated on 17-Jan-2020 09:35:54

148 Views

More is a command to view (but not modify) the contents of a text file, one screen at a time. It is available on Unix and Unix-like systems, DOS, OS/2, and Microsoft Windows. Programs of this sort are called pagers. More is a very basic pager, originally allowing only forward navigation through a file, though newer implementations which allows for limited backward movement.The basics of more command should be like this –$ more /var/log/dkpg.logThe sample output should be like this –2016-12-02 11:30:45 startup archives unpack 2016-12-02 11:30:45 install python-ptyprocess:all 0.5-1 2016-12-02 11:30:45 status half-installed python-ptyprocess:all 0.5-1 2016-12-02 11:30:45 status ... Read More

Print All Paths from Source to Destination in C++

sudhir sharma
Updated on 16-Jan-2020 12:44:35

397 Views

In this problem we are given a directed graph and we have to print all paths from the source to the destination of the graph.Directed graph is a graph in with edges that are directed from vertex a to b.Let’s take an example to understand the problem Source = K destination = POutput:K -> T -> Y -> A -> P K -> T -> Y -> P K -> A -> PHere, we have found paths from K to P. We have traversed paths and printed all paths from K that direct us to P.To solve this problem, we will ... Read More

Print All Paths in a Matrix with Four Moves in C++

sudhir sharma
Updated on 16-Jan-2020 12:39:11

279 Views

In this problem, we are given an mXn 2D matrix and we have to print all possible paths from top left to bottom right of matrix. For traversal, we can move in all four directions i.e. left, right, top, bottom.Thought the moves right and top are rarely used but these can be beneficial sometimes.Let’s take an example to understand the topic better :Input:1 3 5 2 8 9Output:1 -> 3 -> 5 -> 9 1 -> 3 -> 8 -> 9 1 -> 2 -> 8 -> 9To solve this problem, we will move from one cell to other ... Read More

Print All Permutations in Sorted Lexicographic Order in C++

sudhir sharma
Updated on 16-Jan-2020 12:29:24

553 Views

In this problem, we are given a string of length n and we have to print all permutations of the characters of the string in sorted order.Let’s take an example to understand the problem :Input: ‘XYZ’Output: XYZ, XZY, YXZ, YZX, ZXY, ZYX.Here we have to print all permutations in lexicographical order (alphabetically increasing order).To solve this problem, we have to first sort the array in alphabetically increasing order, the sorted array is the first element of the permutation. And then generate the next higher order permutation of the string.The below code will make the solution more clear to you :Example Live ... Read More

Printing Different Patterns in C++

Ajay yadav
Updated on 16-Jan-2020 12:20:09

389 Views

This article is intended to print a half-pyramid pattern bash using the C++ programming language. In the view of the stipulated pattern to be printed, the following algorithm is being orchestrated to achieve our goal as;AlgorithmStep-1 Set the length of the Bash (Height) Step-2 Outer loop to handle the number of rows Step-3 Inner loop to handle columns Step-4 Print the pattern with the character (@) Step-5 Set the pointer to a new line after each row (outside the inner loop) Step-6 Repeat the loop till the Bash HeightExampleSo, the following C++ source code is ultimately carved out by complying ... Read More

Printing Interesting Patterns in C++

Ajay yadav
Updated on 16-Jan-2020 12:18:55

326 Views

This article prints an interesting pattern using C++ programming. Here is the algorithm as followingAlgorithmStep-1 Define the size which will be double automatically Step-2 Print the upper section using a loop Step-3 Print the lower section using a loopExampleBased on the above algorithm, the following c++ code is carved out as; Live Demo#include using namespace std; int main(){    int n=3;    int i,j;    // This is upper half of pattern    for (i=1; i

Advertisements