Tag

C Programming

Browsing

Following the  previous post about Queues, In this post i publish a simple modular stack written in C which can be used either by assigning a static space for the elements of a dynamic one (malloc etc). In computer science, a stack is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes the most recently added element…

In this post i publish a simple modular queue written in C which can be used either by assigning a static space for the elements of a dynamic one (malloc etc). Queue is a particular kind of abstract data type or collection in which the entities in the collection are kept in order. The only requirement is that the memory space which will hold the queue items have to be allocated in prior. Below is the header/source…

Occasionally we might come across a problem which lends itself well to the idea of C# code being compiled at runtime. The .NET Framework includes a mechanism called the Code Document Object Model (CodeDOM) that enables developers of programs that emit source code to generate source code in multiple programming languages at run time, based on a single model that represents the code to render. We can use the CSharpCodeProvider to do exactly this, it can compile…

An array $latex a $ is called beautiful if for every pair of numbers $latex a_i $, $latex a_j $, ($latex i \neq j $), there exists an $latex a_k $ such that $latex a_k = a_i * a_j $. Note that $latex k $ can be equal to $latex i $ or $latex j $ too. Input First line of the input contains an integer T denoting the number of test cases. T test cases…