
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 33676 Articles for Programming

10K+ Views
A hash table is a data structure which is used to store key-value pairs. Hash function is used by hash table to compute an index into an array in which an element will be inserted or searched.Linear probing is a collision resolving technique in Open Addressed Hash tables. In this method, each cell of a hash table stores a single key–value pair. If a collision is occurred by mapping a new key to a cell of the hash table that is already occupied by another key. This method searches the table for the following closest free location and inserts the ... Read More

1K+ Views
Rolling hash is a hash function in which the input is hashed in a window that moves through the input.Rabin-Karp is popular application of rolling hash. The rolling hash function proposed by Rabin and Karp calculates an integer value. For a string the integer value is numeric value of a string.The Rabin–Karp string search algorithm is often explained using a very simple rolling hash function that only uses multiplications and additions −H=c1ak-1+c2ak-2+….+ cka0.Where, a is a constant, and c1, c2….ck are the input characters. In order to manipulate Huge value of H, mod n is done.AlgorithmBegin Declare a constant ... Read More

3K+ Views
A hash table is a data structure which is used to store key-value pairs. Hash function is used by hash table to compute an index into an array in which an element will be inserted or searched.Double hashing is a collision resolving technique in Open Addressed Hash tables. Double hashing uses the idea of using a second hash function to key when a collision occurs.This is a C++ program to Implement Hash Tables chaining with double hashing.AlgorithmFor search a key:Begin Declare Function SearchKey(int k, HashTable *ht) int hashVal= HashFunc1(k, ht->s) int stepSize= HashFunc2(k, ... Read More

4K+ Views
A hash table is a data structure which is used to store key-value pairs. Hash function is used by hash table to compute an index into an array in which an element will be inserted or searched.This is a C++ program to Implement Hash Tables chaining with singly linked lists.AlgorithmFor insert:Begin Declare Function Insert(int k, int v) int hash_v = HashFunc(k) HashTableEntry* p = NULL HashTableEntry* en = ht[hash_v] while (en!= NULL) p = en en= en->n ... Read More

630 Views
A hash table is a data structure which is used to store key-value pairs. Hash function is used by hash table to compute an index into an array in which an element will be inserted or searched.This is a C++ Program to Implement Hash Tables Chaining with List Heads.AlgorithmFor insert:Begin Declare function Insert(int k, int v) int hash_v = HashFunc(k) if (ht[hash_v] == NULL) ht[hash_v] = new ListHead(k, v) else ListHead *en = ht[hash_v] while (en->n != NULL) ... Read More

281 Views
In this article, we will see what is the conversion operator in C++. C++ supports object-oriented design. So we can create classes of some real-world objects as concrete types.Sometimes we need to convert some concrete type objects to some other type objects or some primitive datatypes. To make this conversion we can use conversion operator. This is created like operator overloading function in class.In this example, we are taking a class for complex numbers. It has two arguments real and imaginary. When we assign the object of this class into some double type data, it will convert into its magnitude ... Read More

2K+ Views
Stack and heap are used to store variables during the execution of the program and it also get destroyed.Global data structures or global variables are not consumed by stack or heap. They basically allocated in a fixed memory block, which remains unchanged.int a[10]; // located in a fixed memory block int main() { int main() { float *ptr = (int *)malloc(sizeof(float)10.0)); //use heap. } }

22K+ Views
Dereferencing is used to access or manipulate data contained in memory location pointed to by a pointer. *(asterisk) is used with pointer variable when dereferencing the pointer variable, it refers to variable being pointed, so this is called dereferencing of pointers. int main() { int a = 7, b ; int *p; // Un-initialized Pointer p = &a; // Stores address of a in ptr b = *p; // Put Value at ptr in b }Here, address in p is basically address of a variable.Complete tutorial on dereferencing: C++ Dereferencing

626 Views
Both languages (C and C++) support void pointers, but their behaviour is different. In C, a void pointer can be directly assigned to any other pointer type without the need for a typecast. However, in C++, assigning a void pointer to any other pointe type require an explicit typecast. In this article, we will learn the differences between void pointers in C and C++.. Void Pointer in C A void pointer (also called a generic pointer) in C is a special type of pointer that can point to any data type, but doesn’t have any type by itself. It ... Read More

1K+ Views
The character constant is a constant that is enclosed in a single quote (' '). It represents the integer value (i.e., ASCII) of the character. In C programming language, the data type of character constant is an integer (represented by int) and it needs 4 bytes to store a character constant. For example: 'A', '1', '3', etc., are the character constants. In C++, the data type for character constants is char and it needs only 1 byte to store a character constant. Here are the size of different data types in bytes: ... Read More