Server Side Programming Articles - Page 1916 of 2646

Barabasi Albert Graph (for Scale Free Models) in C/C++?

Arnab Chakraborty
Updated on 29-Jan-2020 11:00:00

331 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

The time Module in Python

Mohd Mohtashim
Updated on 29-Jan-2020 11:08:47

513 Views

There is a popular time module available in Python which provides functions for working with times and for converting between representations. Here is the list of all available methods −Sr.NoFunction with Description1time.altzoneThe offset of the local DST timezone, in seconds west of UTC, if one is defined. This is negative if the local DST timezone is east of UTC (as in Western Europe, including the UK). Only use this if daylight is nonzero.2time.asctime([tupletime])Accepts a time-tuple and returns a readable 24-character string such as 'Tue Dec 11 18:07:14 2008'.3time.clock( )Returns the current CPU time as a floating-point number of seconds. To measure computational ... Read More

Balanced expressions such that given positions have opening brackets in C++?

Arnab Chakraborty
Updated on 29-Jan-2020 10:57:50

238 Views

In case of a given integer m and an array of positions ‘position[]’ (1

Autorun a Python script on windows startup?

Arnab Chakraborty
Updated on 29-Jan-2020 10:43:54

1K+ Views

Appending a Python script to windows start-up basically indicates the python script will run as the windows boots up. This can be accomplished by two step processes -Step #1: Appending or Adding script to windows Startup folderAfter booting up of the windows, it executes (equivalent to double-clicking) all the application present in its startup folder or directory.AddressC:\Users\current_user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\By default, the AppData directory or folder under the current_user is hidden that enable hidden files to get it and paste the shortcut of the script in the given address or the script itself. Besides this the .PY files default must be set ... Read More

Arrange consonants and vowels nodes in a linked list in C++?

Nishu Kumari
Updated on 06-Aug-2025 11:10:56

257 Views

A singly linked list is a fundamental data structure that consists of nodes,  where each node contains a data field and a reference to the next node in the linked list. The next of the last node is null, indicating the end of the list. The given task is to rearrange the linked list in such a way that all the vowel nodes precede the consonants while maintaining the order of their arrival. Scenario Input: a -> b-> c -> d-> e-> f-> g-> h-> i Output: a-> e-> i-> b-> c-> d-> f-> g-> h To solve this problem, we ... Read More

Arrange a binary string to get maximum value within a range of indices C/C++?

Arnab Chakraborty
Updated on 29-Jan-2020 08:14:40

277 Views

In case of a given string consisting of only 0’s and 1’s, we are given M non-intersecting ranges A, B( A

Are array members deeply copied in C++?

Aman Kumar
Updated on 24-Jul-2025 15:49:59

1K+ Views

In C++, an array member is simply the individual elements stored within an array. What is Deep Copy? A deep copy creates a new object and allocates separate memory for the dynamically allocated resources; it copies all the data members of the original object into the new object. So that the new object is completely independent of the original. When a class has a pointer to dynamic memory, the default copy constructor and assignment operator will perform a shallow copy, which is a copy of the pointer rather than the data. So, must define our own ... Read More

Angle between a chord and a tangent when angle in the alternate segment is given in C++?

Manisha Chand
Updated on 08-Aug-2025 11:17:45

209 Views

In this problem, we are given a circle whose chord and tangent meet at a particular point. The angle in the alternate segment of a circle is given. We need to find the angle between the chord and the tangent. According to the Alternate Segment Theorem the angle between a chord and a tangent is equal to the angle in the alternate segment of the circle. Chord and Tangent The chord of a circle can be defined as the line segment joining any two points on ... Read More

An in-place algorithm for String Transformation in C++

Nishu Kumari
Updated on 06-Aug-2025 16:18:30

232 Views

We are given a string and need to move all characters at even positions to the end of the string while maintaining the original order of both even-positioned and odd-positioned characters. The transformation should be done in-place (without using extra space) and in O(n) time. Let's look at a few example scenarios to understand the problem clearly. Scenario 1 Input: T1u2t0o6r2i0a0l4s Output: Tutorials12062014 Explanation: Odd-positioned characters are T u t o r i a l s. Even-positioned characters are 1 2 0 6 2 0 1 4. We place the even-positioned characters at the end while keeping their ... Read More

An application on Bertrandís ballot theorem in C/C++

Arnab Chakraborty
Updated on 29-Jan-2020 07:51:43

238 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

Advertisements