sudhir sharma

sudhir sharma

975 Articles Published

Articles by sudhir sharma

Page 93 of 98

Z-Buffer or Depth-Buffer method in C++

sudhir sharma
sudhir sharma
Updated on 17-Apr-2020 2K+ Views

The z-buffer also known as depth-buffer is a method that is used for hidden surface detection.Hidden surface detectionFor any picture that has objects and surfaces that are transparent. In this case, objects that are behind other objects are hidden. For proper visual of the image, we need to remove these hidden surfaces is required. The identification is called hidden surface problem.In z-buffer, we will compare surfaces in the z-axis as depths.AlgorithmStep 1: initialize the depth of all pixel max.    d(i, j) = infinity Step 2: Initialize color for all pixels.    c(i, j) = background-color Step 3: for each ...

Read More

Pipes and Cisterns in C++

sudhir sharma
sudhir sharma
Updated on 17-Apr-2020 243 Views

Pipes and cisterns problem is a very common problem and is generally included in competitive exams. So, learning questions related to pipers and cisterns is important and you should know how to solve them as these are not too difficult to learn.Pipes and cisternsThese problems involve pipes that are used to either fill or empty a tank/reservoir/cistern.Here, are some basics of pipes and cisterns problem, The pipes are inlet pipes or outlet pipes. Inlet pipe fills the tank and the outlet pipe empties the tank.If a pipe fills/empties in ‘n’ hours and the capacity of the tank is ‘c’ liters. ...

Read More

Popular tools for data analytics in C++

sudhir sharma
sudhir sharma
Updated on 17-Apr-2020 428 Views

Data analytics is the processing of data to extract useful information that supports the machine to make decisions. The processing of data involves cleaning, remodeling, and inspecting data.Data analytics requires high computing power as the data to process is too large. So there are specialized tools for data analytics.Some popular data analytics tools are −R programmingR is one of the best and most widely used tools for data analytics available for all major platforms like Windows, macOS, Unix. It has found usage in data modeling and statistics. Easily manipulation and representation of large data are done using R as it ...

Read More

Portable applications in Cloud and their barriers in C++

sudhir sharma
sudhir sharma
Updated on 17-Apr-2020 301 Views

Cloud Computing − cloud computing or internet-based computing is storing and accessing of data on virtual servers that are hosted over internet on cloud servers instead of local server.Cloud computing provides the user with an option to use the data on the go. This increases the portability of work i.e. the data and processing of cloud computing can be used anywhere by the user. This is not device and location specific.This feature of cloud computing is important for corporates as they can use cloud services to run projects from virtual locations. The services like IAAS, PAAS, SAAS are used to ...

Read More

Practice questions on Arrays in C++

sudhir sharma
sudhir sharma
Updated on 04-Feb-2020 1K+ Views

Array is a data structure that store data in the contagious memory location.Declaring arraysDeclaring arrays is done by the following syntax : int 1D[] - for 1-D array int 2D[][] - for 2-D arrayIf you initialize an array with lesser number of elements, rest are initialized with 0.Memory address of elements of the array1-D array : address[i] = baseAddress + i*size 2-D array (row major) : address[i][j] = baseAddress + (i*n + j) * sizeNow, let’s see some practice problemPredict the output of the following code snippetint arr[5] = {6, 9}; for(int i = 0; i

Read More

Practice questions on Strings in C++

sudhir sharma
sudhir sharma
Updated on 04-Feb-2020 755 Views

String is an important part of programming. Strings are the array of character types. In competitive exams like GATE also it is an important topic. So let’s discuss some key points about string and then we will proceed to some questions that will help you clear your concepts about string.String in a programming language can be stored in two different ways. They are using character array (char str[size]) and using a pointer that will point to the string (char * ch = “Hello”). There are some important things related to the use of the character array and pointer to a ...

Read More

Practice Set for Recurrence Relations

sudhir sharma
sudhir sharma
Updated on 04-Feb-2020 539 Views

Recurrence relations are equations that recursively defines a multidimensional array.Here we will solve so questions based on recurrence relations.Solve the recurrence reation:T(n) = 12T(n/2) + 9n2 + 2. T(n) = 12T(n/2) + 9n2 + 2. Here, a = 12 and b = 2 and f(n) = 9(n)2 + 2 It is of the form f(n) = O(n^c), where c = 2This form its in the master’s theorem condition, So, logb(a) = log2(12) = 3.58 Using case 1 of the masters theorm, T(n) = θ(n3.58).Solve the recurrence reation:T(n) = 5T(n/2 + 23) + 5n2 + 7n - 5/3. T(n) = 5T(n/2 ...

Read More

Primary key Vs Unique key

sudhir sharma
sudhir sharma
Updated on 03-Feb-2020 12K+ Views

Primary KeyPrimary Key is a column that is used to uniquely identify each tuple of the table.It is used to add integrity constraints to the table. Only one primary key is allowed to be used in a table. Duplicate and NULL (empty) values are not valid in the case of the primary key. Primary keys can be used as foreign keys for other tables too.Let’s take an example, We have a table name employee which stores data of employees of a company. The below table shows the contents of the table.Emp_idNamePh_No.PositionSalaryEmp_id here is primary key of the table. As the ...

Read More

Print all nodes that are at distance k from a leaf node in C++

sudhir sharma
sudhir sharma
Updated on 22-Jan-2020 263 Views

In this problem, we are given a binary tree and a number K. We have to print all nodes of the tree that are at k distance from the leaf node.Binary Tree is a special tree whose each node has at max two nodes (one/two/none).The leaf node of a binary tree is the node at end of the tree.In this problem, distance from the leaf node is the node at a higher level than the leaf node. Suppose, the node at distance 2 from the leaf node at level 4 will be at level 2.Let’s take an example to understand ...

Read More

Print all odd numbers and their sum from 1 to n in PL/SQL

sudhir sharma
sudhir sharma
Updated on 22-Jan-2020 3K+ Views

In this problem, we are given a number n and we have to print all odd numbers from 1 to n and also print the sum of numbers from 1 to n in PL/SQL.PL/SQL is a procedural language extension to SQL. The code is a sequence of instructions that are ground in a block with all related declarations and instructions.Let’s see an example of our problem −Input: 7 Output: odd numbers are: 1, 3, 5, 7 Sum of odd numbers is 16To solve this problem, we will take a number and initialize it to 1 and a sum variable with ...

Read More
Showing 921–930 of 975 articles
« Prev 1 91 92 93 94 95 98 Next »
Advertisements