- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 1401 Articles for C
203 Views
The Barabási-Albert model is treated as one of several proposed models that produce scale-free networks. It combines two important general concepts: growth and preferential attachment. Both concepts i.e. growth and preferential attachment have wide existence in real networks. The meaning of growth is that the number of nodes in the network increases over time.The meaning of preferential attachment is that the more connected a node is, the more chance it is to receive new links.Higher degree nodes have stronger ability to catch or grab links added to the network. Basically, the preferential attachment can be well understood if we think ... Read More
123 Views
In Bertrand's original paper, he explains a proof depended on a general formula for the number of favourable sequences implementing a recursion relation.ExampleLet there are 5 voters, of whom 3 vote for candidate A and 2 vote for candidate B (so p = 3 and q = 2). Ten possibilities are exist for the order of the votes cast −AAABBAABABABAABBAAABAABBAABABABAABAABBAABABAABBAAAFor the order AABAB, the tally of the votes as the election progresses is given below −CandidateAABABA12233B00112For each column the tally for A is always greater than the tally for B so the A is always strictly ahead of B. For ... Read More
83 Views
With respect of a given number, display or print all possible combinations of strings that can be implemented to dial the given number in a phone with the help of following pecifications.In the given phone, we can dial, 2 implementing A or B or C, 3 implementing D or E or F, ……………….8 implementing T or U or V, 9 implementing W or X or Y or Z, 1 implementing only 10 implementing 0.For example if 89, is the given phone number, the program should printTW, TX, TY, TZ, UW, UX, UY, UZ, VW, VX, VY, VZ#include #include ... Read More
213 Views
We know that ternary operator is implemented instead of if..else clause. It is denoted by ?: . '?' symbol is equivalent to if part and ':' is equivalent to else part. The following 3 programs explain some interesting observation in case of ternary operator.The following program is able to compile without any error. Ternary expression’s return type is expected to be float (as that of exp2) and exp3 (i.e. literal zero - int type) is able to implicitly convert to float.#include using namespace std; int main(){ int test1 = 0; float fvalue = 3.111f; cout
330 Views
It is already cleared that the BASH fork bomb is much more powerful than its version of C program. The main cause is that in BASH the created process is detached from the parent. If the parent process (the one we initially started) is destroyed or killed, the remaining or rest of the processes live on. But in case of the C implementation, the listed child processes die automatically if the parent is destroyed or killed. A script is responsible to communicate with the system directly.The fork bomb program in C can be updated or modified. We can be able ... Read More
941 Views
An AA tree in computer science is defined as a form of balanced tree implemented for storing and retrieving ordered data efficiently. AA trees are treated as a variation of the red-black tree, a form of binary search tree which supports efficient addition and deletion of entries. As opposed to red-black trees, red nodes on an AA tree can only be added as a right subchild, no left subchild. The result of this operation is the simulation of a 2-3 tree instead of a 2-3-4 tree, which causes simplification the maintenance operations. The maintenance algorithms for a red-black tree require ... Read More
1K+ Views
A-Buffer technique in computer graphics is a simple hidden face detection mechanism used to medium scale virtual memory computers. This technique is also known as anti-aliased or area-averaged or accumulation buffer. This technique extends the algorithm of depth-buffer (or Z Buffer) technique. As the depth buffer technique can only be implemented for opaque object but not for transparent object, the A-buffer technique provides advantage in this scenario. Though the A buffer technique requires more memory, but different surface colors can be correctly composed implementing it. Being a descendent of the Z-buffer algorithm, each position in the buffer can locate or ... Read More
131 Views
The Game − Suppose an n × n array of squares. Out of these, some of the squares are empty, some are solid, and some non-solid squares are set by integers 1, 2, 3, … .Each integer maintains or occupies exactly two different squares on the board. The task of the player is to connect the two occurrences of each integer on the board with the help of a simple path implementing horizontal and vertical movements alone. No two different paths are permitted to intersect one another. No path may include any solid square (solid squares are not permitted to ... Read More
1K+ Views
The idea is to implement the fact that the Greedy approach provides the best solution for Fractional Knapsack problem.To check whether a particular node can give us a better solution or not, we calculate the optimal solution (through the node) implementing Greedy approach. If the solution calculated by Greedy approach itself is more than the best so far, then we can’t obtain a better solution through the node.Complete Algorithm is given below −Sort all items according to decreasing order of ratio of value per unit weight so that an upper bound can becalculated implementing Greedy Approach.Initialize maximum profit, such as ... Read More