What are the two properties that characterise a good dynamic programming problem?
Dynamic programming is a technique for solving problem and come up an algorithm. Dynamic programming divide the problem into subparts and then solve the subparts and use the solutions of the subparts to come to a solution.The main difference b/w dynamic programming and divide and conquer design technique is that the partial solutions are stored in dynamic programming but are not stored and used in divide and conquer technique.
What Different between bit array and jagged array?
A bit array is a kind of array data structure that stores a sequence of bits or boolean values as an array. It is also called a bitset, bitmap or bitstring.
A bit is the basic unit of data in computer science. The bit represents one of two possible values( 0 or 1, True or False, Yes or No) of a logical condition in the form of 0 and 1.
An example of an eight-bit array is 10011100.
A jagged array is a special kind of multidimensional array that stores a collection of arrays of variable sizes. Each row of the jagged array contains columns of different sizes. It is also called as a ragged array. This implies that you can create an array with each element serving as a pointer(reference or link) to another array of the same type.
Consider an example of a 2D matrix of size 3 X 3. One can say that the rectangular collection of size 3 X 3 will have 3 rows and 3 columns, but this is not the case with jagged arrays. In the case of jagged arrays, the number of rows is fixed, but the number of columns may not be fixed.
The differences between a bit array and a jagged array are as follows:
Array Elements: The elements of a bit array are digits( only 0 and 1), whereas the elements of a jagged array are arrays of variable size.
Example of a bit array: 11011100.
Example of a jagged array:
int jagged_arr[][] = new int[][]{
new int[] { 1, 5, 6, 4 },
new int[] { 2, 3},
new int[] { 9, 8, 7},
};
Dimensionality: A bit array is generally one-dimensional but can be represented as two dimensional bit array. On the other side, a jagged array is a multidimensional array.
Size: The size of the bit array is fixed, whereas the column size of the jagged array may not be fixed.
Complex: A bit array is a simple array data structure, whereas a jagged array is more complex than a bit array.
Parallelism: Bit-level parallelism is possible in a bit array, whereas it is not possible in a jagged array. The bit-level parallelism enables long-term storage and manipulation of small arrays of bits in the register set. It also maximises the use of cache data.
Speed: Jagged array is faster than a bit array since the traversal is faster in jagged arrays than in single or multi-dimensional arrays.
Compactness: The bit arrays have a variety of uses in areas where the efficiency of the system or required space is at a premium due to their compact design. On the other side, the design of jagged arrays is not compact, but they have a flexible design.
Uses: One can use the bit arrays for priority queues and boolean flags. A bloom filter is a hash-based probabilistic data structure to determine if a given element is a component of a set.
A jagged array is mainly used for memory management and faster code execution.
Is there Tools for Design UIUX?
If you are about to take on the career of UI/UX, there are some tools you'll have to know about. It will greatly increase your ability and efficiency. Normally speaking, the whole process of designing for UI/UX designers could be separated into 3 major steps: wireframe, mockup, and prototype. Then you'll have to work not only with your teammates but also with developers. So, a proper tool is of great significance.
Below are some of the most popular tools for your reference:
1. Mockplus Cloud: As a brand-new collaboration tool for designers and developers, it goes far beyond design and workflow—allowing mobile designers to create masterpieces. It allows you to upload your wireframes and visual designs from Photoshop, AdobeXD, and Sketch, and add them to your project folder. A full set of features about prototyping, commenting, collaborating and design handoff enable you to create a product from the start to the very end.
2. Sketch: It is a vector-based design tool that helps you design interfaces quickly and intuitively. Think of Photoshop in combination with Illustrator, but a lightweight software with unlimited artboards. Hundreds of articles have already been written on its various possibilities by industry experts, so I wouldn’t list all of its features. Personally, one of its features that I like is nested symbols.
3. Figma: It is a relatively new tool, with almost the same interface as Sketch.
It’s an innovative tool mainly because it allows a team of designers to collaborate and give comments on a design in real-time. You heard right! Figma’s canvas helps you do your design process in a collaborative way. Suddenly a very interesting situation occurs where the product team, the design team, and the development team can take part in the process.
Well, only your hands-on experience will tell you whether a tool is suitable for you or not. So, you might need to have a play with different tools before you find your favorite one or ones.
Hopefully, this helps.
When converting binary tree into extended binary tree all the original nodes in binary tree are?
will remain same
How do you define the structure size in C language?
You cannot define the size of the structure, but you can query it with sizeof.
The structure size in C language depends on the elements of the structure.
Example:
#include
struct Test
{int v;
char str[100];
};
int main()
{printf("The structure size is %d\n", sizeof(struct Test));
return 0;
}
Why PHP developers prefers Laravel?
Laravel is one of the most preferred PHP frameworks as it has auto-loading to remove maintaining your software, a built-in authentication system you don't have to re-invent for every application, and a lot of other pre-built items that make developing your app easier and faster.
How do you convert pdf file to odt?
Various tools can be used to convert pdf to odt. I prefer using Supertool as it is an online tool and is free of cost. It also provides various other features like merging, cropping, and converting pdfs to black and white or to jpg, png, etc. This tool is super easy to use unlike other online tools that end up asking for money before you can download your file :)
direct data entry can transfer information out amatically from a document such as a farm or barcode into the computer .
What happens if you dont follow correct uninstall procedures?
What happens if you don't follow correct uninstall procedures
What is the advantages and disadvantages of paperless society?
there are no advantages or disadvantages
What is concatenation and when will it be useful?
Concatenation is the joining of two vectors to produce a new vector. The new vector simply appends one vector to the other. A vector is an array of variables of the same type. Concatenation is most commonly used to join two strings together (string concatenation). A string is simply an array of type char.
What editing program does the nostalgia critic use?
I think he uses Adobe Premiere Elements or something.
Why may you recommend the use of a macro instead of a subroutine inside a loop in a program?
A subroutine call generates additional work for the hardware to perform when activated. A macro in general does not call a subroutine but rather puts the commands in-line inside the loop, resulting in a faster program.
Do you have to pay to get into crunchyrollcom?
No you dont need to pay to get a crunchyroll you only need to pay is you wanna become a star member.
What are the Steps of prototyping?
In business or industry bulk productions just don't start right away. A model or prototype is created and tested to go into production afterwards.
the ability to actively think and form ideas and conclusions based solely on personal experience and not pre programmed data
a. Replace the motherboard. b. Disable the modem port and install a modem card in an expansion slot. c. Use an external modem that connects to the serial or USB port. d. Return the motherboard to the factory for repair.
If the motherboard is important, replace the motherboard. Other components may be failing and undetected.
If the motherboard isn't in a critical piece of hardware, I would simply turn the modem off in the BIOS and add a new modem in an expansion slot.
Solution
Let
• x be the number of units of X produced in the current week
• y be the number of units of Y produced in the current week
then the constraints are:
• 50x + 24y <= 40(60) machine A time
• 30x + 33y <= 35(60) machine B time
• x >= 75 - 30
• i.e. x >= 45 so production of X >= demand (75) - initial stock (30), which ensures we meet demand
• y >= 95 - 90
• i.e. y >= 5 so production of Y >= demand (95) - initial stock (90), which ensures we meet demand
The objective is: maximise (x+30-75) + (y+90-95) = (x+y-50) i.e. to maximise the number of units left in stock at the end of the week
Solving simultaneously, rather than by reading values off the graph, we have that x=45 and y=6.25 with the value of the objective function being 1.25
It can be switched off in BIOS of your PC.
In Apple Macintosh there's no COM1 at all.
How do you write an algorithm to check whether a number is a prime number or not?
Checking if a number is prime is a popular question for programming competitions.
It's also necessary when implementing software that generates private keys for RSA public-key encryption.
There are several formulas for computing the prime numbers such as Willans' Formulas and Wormell's Formula. These two are used to generate a prime number.
The simplest way to check if a given number is prime (primality testing) is to search for a factor.
Try possible factors and see if the number can be evenly divided into any of them.
In C, that simple check is:
bool IsPrime(long int number)
{
if (number < 2) return false;
if (number <= 3) return true;
long int ns, temp;
for (ns = 3; ns < number; ns++)
{
temp = number / ns;
if (temp*ns number) {
printf("The smallest prime factor of %li is %li .\n", number, ns );
printf("The product of %li * %li is %li .\n", ns, temp, number );
return false; //can be divided!
}
}
return true;
}
This can be sped up a little more by only checking primes (rather than every odd number), perhaps using the sieve of Eratosthenes to find those primes.
Because all primes are integers, it's usually best not to use floating-point when working with them.
Even with all known speedups, every known method for factorizing a number is still too slow for some applications -- it would take centuries to check the numbers used in RSA public-key encryption -- and so people have developed much faster, much more complicated algorithms for primality testing.
These fast algorithms can prove that a number is almost certainly prime; however, when they indicate that a number is composite, they don't reveal any of the factors of that composite number.
Such fast algorithms include
the Fermat primality test,
the cyclotomy test,
the Lucas test,
the Proth test.
the Miller-Rabin primality test,
the Solovay-Strassen primality test, and
the AKS primality test.
The implementation, of those formula, unfortunately cannot be listed in here.
Write down the equivalent pointer expression for referring the same element aijkl?
it is a[i][j][k][l]; so in pointer reference: *(*(*(*(*(a+i)+j))+k)+l)
How do operating systems handle all the different peripherals that are on the market?
Operating systems usually communicate with peripherals using "drivers", which are usually written by the designers\manufacturers of the peripheral.
Drivers are essentially programs or processes that the operating system loads which contain the necessary routines and information to make use of the peripheral.