Tag Archives: Trivia

Some general stuff

Common String Algorithms

In this post, I would try to implement the following string-related algorithm questions. I would like to implement these using Java and try to make additional comments which I think that are useful for understanding the implementations of some type of data structures in Java programming language. Non Repeated Characters in String : Return the unique characters in… Read More »

Easiest way to change case of alphabets

Here we will discuss the easiest and most simple way to change case of alphabets. Hint : We will be using bit hacks. Often during our programming needs we need to change the case of alphabets. This can be a problem requirement or simply our need to solve the question. There are several ways to do it, but… Read More »

Advanced level Bit Hacks

Here we shall discuss some high level Bit hacks that if used cleverly can really speed up your program execution time. We discussed some of the basic hacks in this post:- Low level bit hacks you must know. Please go through the post to get a little understanding of how the things work. Smart learners are anyways welcome… Read More »

Low level Bit Hacks that you must know

Here we shall discuss some very low level Bit hacks that can really speed up your program execution time when used effectively. Every now and then we see bit level operators. Bit hacks are ingenious little programming tricks that manipulate integers in a smart and efficient manner. Instead of performing some operation (such as counting the 1 bits… Read More »

Unlocking the Enumeration/enum Mystery

What are enums actually? Enums provide an opportunity to the user to define a shorthand for fixed set of constants like months in a year, gender etc. Enumeration is the list of constant integer values, which means that the enum values can’t be modified. Here we are going to explain Enumeration usage rules and constraints in C language.… Read More »

Algorithm Analysis

We have been discussing the time complexities of each of the algorithm that we have discussed. Let us try to analyze, how these time complexities are calculated. O(1) Time complexity of a function (or set of statements) is considered as O(1) if it doesn’t contain loop, recursion and call to any other non-constant time function. For example swap()… Read More »

Find the median of a sequence of n integers.

Question: Given a sequence of integers, find the median of the integers? Input: arr [] = {15, 23, 4, 16, 8, 42}. Find median. Output: 15 Since the question does not specify anything we cannot assume that the given array is a sorted one. The definition of median is the (n/2)th element of a sorted sequence of integers.… Read More »

Some general tips for programming.

A Programming Contest is a delightful playground for the exploration of intelligence of programmers. To start solving problems in contests, first of all, you have to fix your aim. Some contestants want to increase the number of problems solved by them and the other contestants want to solve less problems but with more efficiency. Choose any of the… Read More »

What is a wild pointer?

Question: What is a wild pointer in a program? Uninitialized pointers are known as wild pointers. These are called so because they point to some arbitrary memory location and may cause a program to crash or behave badly. This can be understood from the below examples. Please note that if a pointer p points to a known variable… Read More »