• Main Menu
  • C

    • Circular Queue

      Circular Queue

      The difficulty of managing front and rear in an array-based non-circular queue can be overcome if we treat the queue position with index 0 as if it comes after the last position (in our case, index 9), i.e., we treat the queue as circular. Note that we use the same array declaration of the queue.

    • Type Conversion – Basic to Class Type

      Type Conversion – Basic to Class Type

      The conversion from basic to user defined data types can be done using constructors. Consider the following constructor: .cf { font-family: Lucida Console; font-size: 9pt; color: black; background: white; } .cl { margin: 0px; } .cb1 { color: green; } .cb2 { color: blue; } .cb3 { color: maroon; }   String :: String(char *a)

    • Doubly Linked List – Traversing and Search

      Doubly Linked List – Traversing and Search

      Traversing a Doubly Linked List A doubly linked list can be traversed either way and that too very conveniently. Inorder traversal Reverse order traversal Inorder Traversal To traverse the doubly linked list, we walk the list from the beginning, and process each element until we reach the last element. .cf { font-family: Lucida Console; font-size:

    • Postfix


      The sum of X and Y is written as X+Y where + is the operator while X and Y are the operands. We have always learnt to write the sum of two numbers as X + Y; this notation is know as infix. Here, we’ll be talking about the postfix notation of representing arithmetic operations.

    • Inserting in a Doubly Linked List

      Inserting in a Doubly Linked List

      Inserting an Element To insert an element in the list, the first task is to allocate memory for a new node, assign the element to be inserted to the info field of the node, and then the new node is placed at the appropriate position by adjusting appropriate pointers. Insertion in the list can take

    • Binary Tree – Searching a Node

      Binary Tree – Searching a Node

      An element in a binary search tree can be searched very quickly. A search operation on binary tree is similar to applying binary search technique to a sorted linear array. The element to be searched will be first compared with root node. If it matches with the root node then the search terminates. Otherwise search

    • Trees


      Arrays, linked lists, stacks and queues are used to represent linear and tabular data. These structures are not suitable for representing hierarchical data. In hierarchical data we have ancestors, descendants superiors, subordinates, etc Family Structure Business Corporate Structure Federal Government Structure Introduction to Trees Fundamental data storage structures used in programming Combine advantages of ordered

    • Doubly Linked List

      Doubly Linked List

      In a doubly linked list, also called a two-way list, each node is divided into three parts: The first part, called the previous pointer field, contains the address of the preceding element in the list. The second part contains the information of the list. The third part, called the next pointer field, contains the address

    • Type Conversion – Class to Basic Type

      Type Conversion – Class to Basic Type

      The constructor handles the task of converting basic types to class types very well. But you cannot use constructors for converting class types to basic data types. Instead, you can define an overloaded casting operator that can be used to convert a class data type into a basic data type. The general form of an

    • Deleting an Element from a Linear Linked List

      Deleting an Element from a Linear Linked List

      To delete an element from the list, first the pointers are set properly and then the memory occupied by the node to be deleted is deallocated (freed). This tutorial covers the deletion of a node from the following three positions: At the beginning of the list At the end of the list After a given

    175 queries in 0.422 seconds.