Push Back in Deque Using C++ STL

Sunidhi Bansal
Updated on 26-Feb-2020 11:22:30

269 Views

Given is the task to show the functionality of deque push_back( ) function in C++ STLWhat is DequeDeque is the Double Ended Queues that are the sequence containers which provides the functionality of expansion and contraction on both the ends. A queue data structure allow user to insert data only at the END and delete data from the FRONT. Let’s take the analogy of queues at bus stops where the person can be inserted to a queue from the END only and the person standing in the FRONT is the first to be removed whereas in Double ended queue the ... Read More

Print Value for Given Key in Python Dictionary

Jayashree
Updated on 26-Feb-2020 11:22:05

7K+ Views

Python dictionary is collection of key value pairs. Value associated with a certain key is returned by get() method.>>> D1={'a':11,'b':22,'c':33} >>> D1.get('b') 22You can also obtain value by using key inside square brackets.>>> D1['c'] 33

Set Up C/C++ on Eclipse in Windows

Arushi
Updated on 26-Feb-2020 11:21:22

10K+ Views

Step 1 − Install MinGW GCC or Cygwin GCCTo use Eclipse for C/C++ programming, you need a C/C++ compiler. On Windows, you could install either MinGW GCC or Cygwin GCC. Choose MinGW if you are not sure, because MinGW is lighter and easier to install, but has fewer features.MinGW GCCTo install MinGW, go to the MinGW homepage, www.mingw.org, and follow the link to the MinGW download page. Download the latest version of the MinGW installation program which should be named MinGW .exe.While installing MinGW, at a minimum, you must install gcc-core, gcc-g++, binutils, and the MinGW runtime, but you may ... Read More

Type Specifier for Boolean in C++

Govinda Sai
Updated on 26-Feb-2020 11:15:59

255 Views

The type specifier for boolean in c++ is bool. You can use it as −bool myBoolean = true;

Indent Multiple If-Else Statements in Python

Malhar Lathkar
Updated on 26-Feb-2020 11:11:26

3K+ Views

Use of indented blocks is an important feature of Python. Indent level of the block is more than previous statements. Hence, if multiple if statements are present in a program in nested fashion, each subsequent indented block will have increasing level of indent.if expr1==True:     if expr2==True:         stmt1     else:          if expr3==True:         stmt2 else:     if expr3==True:        stmt3     else:        stmt4

List Insert in C++ STL

Sunidhi Bansal
Updated on 26-Feb-2020 11:10:18

9K+ Views

Given is the task to show the functionality list insert( ) function in C++ in STL.What is List in STLList are containers that allow constant time insertion and deletion anywhere in sequence. List are implemented as doubly linked lists. List allow non-contiguous memory allocation. List perform better insertion extraction and moving of element in any position in container than array, vector and deque. In List the direct access to the element is slow and list is similar to forward_list, but forward list objects are single linked lists and they can only be iterated forwards.What is insert( )The list insert( ) ... Read More

Use Break Statement in Python If Clause

Malhar Lathkar
Updated on 26-Feb-2020 11:06:04

217 Views

Python's break keyword is used as decision control statement. It causes the remaining iterations to be abandoned and control of execution goes to next statement after the end of loop. Invariably it is executed conditionally and appears inside if block within a loop.while expr==True:     stmt1         stmt2         if expr2==True:        break     stmt3     stmt4   However it can't be used in an if block if it is not a part of loop. 

Use Continue Statement in Python If Clause

Malhar Lathkar
Updated on 26-Feb-2020 11:05:28

218 Views

Python's continue statement is a loop control statement. It causes starting next iteration of loop after abandoning current iteration. Invariably is is executed conditionally i.e. in if blockwhile expr==True:     stmt1     stmt2     if expr2==True:        continue     stmt3     stmt4However, it can't be used in an if block if it is not a part of loop. If used, interpreter will throw syntax error.

Deque Resize in C++ STL

Sunidhi Bansal
Updated on 26-Feb-2020 11:03:42

246 Views

Given is the task to show the functionality of deque resize( ) function in C++ STL.What is DequeDeque is the Double Ended Queues that are the sequence containers which provides the functionality of expansion and contraction on both the ends. A queue data structure allow user to insert data only at the END and delete data from the FRONT. Let’s take the analogy of queues at bus stops where the person can be inserted to a queue from the END only and the person standing in the FRONT is the first to be removed whereas in Double ended queue the ... Read More

What are the and Operators in Python

Malhar Lathkar
Updated on 26-Feb-2020 10:59:01

251 Views

The symbols > are defined as left and right shift operators respectively in Python. They are bitwise operators. First operand is a bitwise representation of numeric object and second is the number of positions by which bit formation is desired to be shifted to left or right.The >> a=60 >>> bin(a) '0b111100' >>> b=a> b 240 >>> bin(b) '0b11110000'You can see two bits on right set to 0On the other hand >> operator shifts pattern to right. Most significant bits are set to 0>>> a=60 >>> bin(a) '0b111100' >>> b=a>>2 >>> b 15 >>> bin(a) '0b111100'

Advertisements