Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Maximum and Minimum element of a linked list which is divisible by a given number k in C++
A linked list is a linear data structure in which elements are linked via pointers. Each element or node of a linked list has a data part and link, or we can say pointer to the next element in sequence. The elements can take noncontiguous locations in memory.We are given a singly linked list in which there is a data part and link to the next element. The other input is a number K. Task is to find the Maximum and Minimum element of a linked list which is divisible by the number K. The linear linked list can only ...
Read MoreMaximum adjacent difference in an array in its sorted form in C++
We are given with an array. The array need not be sorted. The task is to find the maximum difference between adjacent elements of that array in its sorted form. So the first thing is to sort the array in increasing or decreasing order. Then we will iterate the array and calculate the adjacent difference of Arr[i+1]-Arr[i]. Then for each iteration we will compare this difference with the one which is found maximum so far.Input − Arr[] = [ 1, 5, 10, 2, 7 ]Output − Maximum adjacent difference in array in its sorted form is 3.Explanation − Sorted Arr[] ...
Read MoreMaximize the sum of X+Y elements by picking X and Y elements from 1st and 2nd array in C++
For the given two arrays each of size N, the task is to find the maximum sum by choosing X elements from array 1 and Y elements from array 2.Let’s now understand what we have to do using an example −Input arr1 = {1, 2, 3, 4, 5} ; X=2 arr2 = {1, 3, 5, 2, 7}; Y=3Output Maximum sum here is : 24Explanation − We are selecting 2 number(s) from arr1 and 3 from arr2. Largest 2 of arr1 are 4, 5 and largest 3 of arr2 are 3, 5, 7. Total sum of these 5 elements is 24 which is ...
Read MoreMaximize the given number by replacing a segment of digits with the alternate digits given in C++
Given the task is to maximize a given number with ‘N’ number of digits by replacing its digit using another array that contains 10 digits as an alternative for all single-digit numbers 0 to 9, The given condition is that only a consecutive segment of numbers can be replaced and only once.Input N=1234, arr[]={3 ,0 ,1 ,5 ,7 ,7 ,8 ,2 ,9 ,4}Output 1257Explanation The number 3 can be replaced with its alternative 5= arr[3]The number 4 can be replaced with its alternative 7= arr[4]Input N=5183, arr[]={3 ,0 ,1 ,5 ,7 ,7 ,8 ,2 ,9 ,4}Output 7183Approach used in the below program as followsIn function ...
Read MoreMaximize the profit by selling at-most M products in C++
Given the task is to calculate the maximum profit that can be made by selling at-most ‘M’ products.The total number of products are ‘N’ and the cost price and the selling price of each product is given in the lists CP[] and SP[] respectively.Input N=6, M=4 CP[]={1, 9, 5, 8, 2, 11} SP[]={1, 15, 10, 16, 5, 20}Output 28Explanation − The profit obtained from selling all the products are 0, 6, 5, 8, 3, 9 respectively.So, in order to make maximum profit by selling only 4 products, the products with the highest profit need to be chosen, that is, product number 2, ...
Read MoreWhat are liabilities in accounting?
According to International Financial Reporting standards (IFRS), Liabilities are present obligations of the enterprises arising from past events, the settlement of which is expected to result in an outflow from the enterprises of resources embodying economic benefits.In simple words, it is amount owned by the company to the creditors.Classification of liabilities is as follows −Current liabilities − Payment period is less than one year. It is also called as short term liability.Examples − Accounts payable, interest payable, income tax payables, bills payable, bank account overdrafts, accrued expenses, short term loans.Non – current liabilities − Payment period is more than one ...
Read MoreWhat are assets in accounts?
An asset is a resource which has an economic value which can generate future cash flows. It is owned or controlled by individuals, corporation or a government. Asset can be a property, inventory, trademarks or patents.Based on its liquidity, assets are recorded in the balance sheet in descending order. More the asset is liquid takes more time to convert into cash.Classification of assetsThe assets are classified as follows −ExamplesThe examples of assets as per convertibility are as follows −Currents assets − Cash, cash equivalents, short term deposits, stock, office supplies, marketable securities etc.Non- current assets − Land, building, equipment, machinery, ...
Read MoreExplain the difference between accrual base accounting vs cash based accounting.
The main difference between accrual base accounting and cash base accounting is as follows −Cash based accountingAccrual based accountingIt is a single entry accounting.Only cash transactions are recognised.Doesn’t recognise account receivables or accounts payable.Useful for small companies.Easy to understand.Focus on liquidity.Not recognised by companies act.Not a holistic approach.Not more accurate.Matching concept can’t be applicable.Low degree of accuracy.Shows lower income in income statement.Doesn’t meet GAAP requirements.Can mislead financial status.It is double entry accounting.Revenue and expenses are recorded irrespective of cash.Commonly used method.Complex and difficult to understand.Recognised by companies act.Focus on revenue, expenses, profit and loss.It has holistic approach.More accurate method.Match concept ...
Read MoreExplain cash based accounting.
Cash based accounting means, it records only those transactions relates to cash. That means transactions of revenue and expenses are recorded when payments are made or received through cash only. It is a single entry accounting.It is useful for simple accounting system.It is used, if inventory is to be valued.It is useful, when audit is not necessary.It is useful in services business.Reasons why companies prefer cash based accounting are given below −Single entry accounting.Few financial transactions.Very few employees.Few valuable physical assets.Very few inventory, supplies and cash in bank.Sole proprietorship.Privately held.Legal reporting includes −Supports company’s income tax reporting.Paid government taxes.Forecast future ...
Read MoreExplain the concept of book keeping in accounting.
Bookkeeping is keeping the record of business transactions on day to day basis. It includes identifying, measuring and recording of transactions. Bookkeeping is basis of preparing accounting statements. It records below transactions, but not limited to, Payments to suppliers.Loan payments.Invoice payments.Asset depreciation.Generating financial reports.In olden days, that means days before digitalisation. Bookkeeping starts with entries in general ledgers, later in place of general ledgers special ledgers and day books were introduced. Special ledgers are separated ledgers for sales, purchases, cash receipts, cash payments etc. these entries were made on day wise.Likewise, ledgers for sales, rent, wages, loans etc. are maintained ...
Read More