Powered by Blogger.

Data Structure in C++



Data Structure in C++

Data structures are used to store data in a computer in an organized form. Here we discuss all data structure in c++ like, linked list, stack, queue, tree etc. Here we discuss about data structure in C++.

Data Structure in C++

Following Data Structure available in C++


  • Stack
  • Queue
  • Linked List
  • Tree


Data structures are generally based on the ability of a computer to fetch and store data at any place in its memory.

Data structures can implement one or more particular abstract data types, which specify the operations that can be performed on a data structure and the computational complexity of those operations. In comparison, a data structure is a concrete implementation of the specification provided by an ADT.

Example of POP Operation in Stack

#include <iostream>       // std::cout
#include <stack>          // std::stack
int main ()
{
  std::stack<int> mystack;
  for (int i=0; i<5; ++i) mystack.push(i);
  std::cout << "Popping out elements...";
  while (!mystack.empty())
  {
     std::cout << ' ' << mystack.top();
     mystack.pop();
  }
  std::cout << '\n';
  return 0;
}

Output

Popping out elements... 4 3 2 1 0
For read more you can try these things;
C++ Data Structure, C++ Data Structure for class 12th




facebook
google-plus
twitter
pinterest

No comments :

Post a Comment

HTML Tutorial

images

About Sitesbay

This blog is related to Java Tutorial, C++ Tutorial, C Tutorial, Online Earning tips and more in very simple and easy way. Here i will try to give complete idea related to all new technology.

Java Tutorial

Java is Object oriented programming language, It is more secure and high performance language.

C++ Tutorial

C++ is also Object oriented programming language, It is more simple and easy to learn.

 
https://sitesbay.blogspot.com/?utm_medium=d2898efa59afcc0bc411921036e22b767ca37b09